2

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.

13
  • Check in console network, after uploading image you would getting error in ajax response. Please check response and share error here Jun 25, 2019 at 9:29
  • Shaoib - it's in the original question above! Or do you mean something else - please explain? Jun 25, 2019 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. Jun 25, 2019 at 10:47
  • Thanks Shoaib - where do I find the response.? And the log? Jun 25, 2019 at 10:56
  • 1
    @ShoaibMunir ini_set('memory_limit', '-1'); is not working for me, checked in console the ajax response returns to login page. In log i got Not valid template file:adminhtml/base/default/template/system/config/system/storage/media/synchronize.phtml Not valid template file:frontend/base/default/template/configurableswatches/catalog/media/js.phtml do you have any suggestion for it Nov 24, 2020 at 13:32

2 Answers 2

2

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

2
  • Good to hear that. +1 on your answer, please mark my answer correct if it is helpful to you Jun 25, 2019 at 11:26
  • I will do - but cannot for 48 hours Jun 26, 2019 at 10:10
1

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

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.