Closed Dacarts closed 12 years ago
Fixed it! The problem was that a warning was being outputted by the console. This disturbed the return I fixed the warning regarding the Timezone and it's now working
Check the server repsonse content. It should point to the error/warning cause.
On Mon, Jun 9, 2014 at 1:37 PM, melcarthus notifications@github.com wrote:
notflip you said you fixed it but you don't post any solutions. Im having the same error message when I want to upload images. I get the json error when clicking upload.
— Reply to this email directly or view it on GitHub https://github.com/blueimp/jQuery-File-Upload/issues/647#issuecomment-45482637 .
It would be helpful of everyone who is posting a solution to also put in a little more detail. Like where the files are that they are mentioning. The error i'm having probably has to do with permission but they are set als they should...
SyntaxError: Unexpected token g
OK
guage->get('error_permission');
}
if (!isset($json['error'])) {
if (@move_uploaded_file($this->request->files['image']['tmp_name'], $directory . '/' . $filename)) {
$json['success'] = $this->language->get('text_uploaded');
} else {
$json['error'] = $this->language->get('error_uploaded');
}
}
$this->response->setOutput(json_encode($json));
}
Must use absolute url instead of relative
www.site.com.br/assets/
Do not use
.. / .. /
I had the problem with "SyntaxError: Unexpected end of input", for which the problem was that url in fileupload was incorrect(I forgot to update it).
And the problem with "SyntaxError: Unexpected token <" is probably that you are printing out something on server in action/function which is handling the file upload. UploadHandler is already generating a response and if you print out something as well it's probably gonna break.
Like @ingelity says you can only return a clean output, I was getting a warning returned with the input regarding the timezone not being set. When i fixed the warning it all worked well
took me a while to get it... below is what worked for me. i had changed the location and renamed the "server/php/" folder and that is why i was getting the error. To fix the issue i had to edit the "js/main.js" file. go to line:18. it looks like: $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'server/php/' });
so i changed it to point to my new "server/php/" which is now "inc/file_upload/" folder to look like:
$('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'http://localhost/mysite/inc/file_upload/' });
...and the error was gone! i hope this helps.
new \Imagick -> new Imagick new \stdClass -> new stdClass
I had the same problem after integrating the plugin into my website. The problem was the mod_rewrite my cms is using. I fixed that with giving an absolute path to the server/php/ directory in main.js at line 21. May others having the same scenario.
Hi im trying to upload images files but everytime i push upload
i get this - Error: SyntaxError: Unexpected token <
pleas help and thx for any help.