I am trying to upload an image - something which I have done a hundred times. Now it gets stuck with "uploading..." showing.

  • I have tried disabling extensions.
  • I haven't made any changes.
  • There have been no updates.
  • The images is 1.00mMb
  • I have checked for existing zero sized images
  • I have tried multiple browsers
  • I have reindexed and cleared the cache
  • I have tried incognito mode

The Error I get in console is:

Uncaught SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at String.parseJSON [as evalJSON] (30fee76906a26cc4fffab3ed736897bb.js:720)
at klass.onFileSuccess (30fee76906a26cc4fffab3ed736897bb.js:22344)
at d.<anonymous> (30fee76906a26cc4fffab3ed736897bb.js:391)
at d.<anonymous> (30fee76906a26cc4fffab3ed736897bb.js:21540)
at k (30fee76906a26cc4fffab3ed736897bb.js:21540)
at d.fire (30fee76906a26cc4fffab3ed736897bb.js:21540)
at e.chunkEvent (30fee76906a26cc4fffab3ed736897bb.js:21540)
at f.event (30fee76906a26cc4fffab3ed736897bb.js:21540)
at XMLHttpRequest.doneHandler (30fee76906a26cc4fffab3ed736897bb.js:21540)

For some reason, The strings "anonymous" is being parsed which is creating an error. I'm not sure the problem is specific to the uploader.

  • Check in console network, after uploading image you would getting error in ajax response. Please check response and share error here – Shoaib Munir Jun 25 '19 at 9:29
  • Shaoib - it's in the original question above! Or do you mean something else - please explain? – Kevin Russell Jun 25 '19 at 10:33
  • The error you are getting in console is not the actual error, it is showing it because some ajax is not responding properly. You can check actual error in exception.log or in ajax response. – Shoaib Munir Jun 25 '19 at 10:47
  • Thanks Shoaib - where do I find the response.? And the log? – Kevin Russell Jun 25 '19 at 10:56
  • in console, open Network tab, clear previous log and upload image, you will see ajax sending requiest, open that request and get response from response tab. But first check var/log/exception.log see if you are getting any error in it. – Shoaib Munir Jun 25 '19 at 11:00

As instructed by @ShoaibManir I added this code to index.php:

Use ini_set('memory_limit', '-1');

...to fix my problem. Although the images was a 1Mb file, I have since noticed that reducing the image resolution (to 1000 x 1000) also worked without the code added.

Thanks chaps. Kevin

|improve this answer|||||
  • Good to hear that. +1 on your answer, please mark my answer correct if it is helpful to you – Shoaib Munir Jun 25 '19 at 11:26
  • I will do - but cannot for 48 hours – Kevin Russell Jun 26 '19 at 10:10

According to your comments you are getting this error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 11912 bytes) in /home/fineand1/public_html/app/code/core/Mage/Core/Model/File/Validator/Image.php on line 101 

to fix this please use ini_set('memory_limit', '-1'); in index.php and in pub/index.php

this is not a good way, but your issue will resolve after this

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.