When I try to upload an image, image is not generating and I always get ajax error.

I cannot upload an image.

I get a 404 ajax error.

enter image description here

I use Drupal 8.54


memory_limit = 254M 
upload_max_filesize = 20M 
post_max_size = 20M 
max_execution_time = 90 

No error - Recent log messages.

The files directory ( sites/default/files ) permissions - 777

I don't find any solution or references about that.


I can't upload file.

When I want to upload more than 8KB files, get ajax error.

  • Stock 8.54 image uploads work fine. Without telling us what custom & contrib modules you have installed, or what could be the likely cause of it, this question will probably end up getting closed as "Unclear what you're asking" or "Too broad".
    – Beebee
    Jun 26 '18 at 16:02
  • Generally image uploads work fine but in my case not. It is core image field ( field_image) Jun 26 '18 at 16:12
  • Any errors in the Watchdog (db logging) log? Also, what do your system error logs say? E.g. the PhP error log or web server error log.
    – CG Monroe
    Jun 26 '18 at 16:22
  • There is no error - db logging, server error log file... I made a short video youtu.be/PQcwu_tTj3s Jun 26 '18 at 17:16
  • Possibly related: drupal.stackexchange.com/q/144323/15055
    – leymannx
    Aug 3 '18 at 20:31

This part of the AJAX error message can be helpful for you:

the requested url /@custom was not found on this server

This may have the following root causes (including but not limited to):

  • .htaccess settings
  • Your settings.php
  • It happens when I try to upload an image more than 8-10 KB. I think - server side issues, not drupal cms issue. Jun 27 '18 at 13:24
  • This means: you have tested with the same image file on localhost and it worked fine?
    – ssibal
    Jun 27 '18 at 13:37
  • No, a remote server, I can upload an image 5KB but more than that - the AJAX error message. Jun 28 '18 at 4:51
  • Maybe you could update your answer with this information
    – ssibal
    Jun 28 '18 at 12:22

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.