Home  »  Wordpress   »   Fix WordPress – An error occurred in the upload. Please try again later

Fix WordPress – An error occurred in the upload. Please try again later

By | July 16, 2015

An error occurred in the upload. Please try again later.

If you get this error while uploading image or any media to WordPress you can only suspect some things and start investigation by changing and checking settings one by one.

Good news – WordPress returns exact error message!

Getting error details

Error details are in the HTTP response from async_upload.php script formatted as JSON.
You can easily find it using build in Developer Tools in Firefox or Developers Console in Chrome.

  1. In Chrome or Firefox press F12 and go to Network tab.

  2. Try to upload image again or do any other action that will trigger the error.

    1. At the bottom left find async_upload.php file name.
    2. Click it and go to Preview tab (see attached images).

    This will show you the error details. Click screenshot below to enlarge.

    Developers Console in Chrome - Click To Enlarge
    image-1311

    Developers Console in Chrome – Click To Enlarge

    Firefox Developer Tools - Click To Enlarge
    image-1312

    Firefox Developer Tools – Click To Enlarge

Fixes for most common error messages

Unable to create directory uploads

{“success”:false,”data”:{“message”:”Unable to create directory uploads\/2015\/07. Is its parent directory writable by the server?“,”filename”:”wordpressErrorImageUpload1.png”}}

  1. Check permissions for upload folder. It should have 755 mask.

    Correct WordPress upload folder permissions
    image-1313

    Correct WordPress upload folder permissions

  2. Check upload path. It can change for example when you switch your hosting company.
    Go to https://your_server/wp-admin/options.php and find upload_path. Check if it is correct.

This file type is not permitted for security reasons

{“success”:false,”data”:{“message”:”Sorry, this file type is not permitted for security reasons.“,”filename”:”wordpressErrorImageUpload1.pdn”}}

Simple – check extension. Maybe you are uploading file with the same name but different extension. png and pdn can get mixed up. List of allowed extension can be found here https://codex.wordpress.org/Uploading_Files

Images
.jpg .jpeg .png .gif .ico .svg

Documents
.pdf (Portable Document Format; Adobe Acrobat) .doc, .docx (Microsoft Word Document) .ppt, .pptx, .pps, .ppsx (Microsoft PowerPoint Presentation) .odt (OpenDocument Text Document) .xls, .xlsx (Microsoft Excel Document) .psd (Adobe Photoshop Document)

Audio
.mp3 .m4a .ogg .wav

Video
.mp4, .m4v (MPEG-4) .mov (QuickTime) .wmv (Windows Media Video) .avi .mpg .ogv (Ogg) .3gp (3GPP) .3g2 (3GPP2)

[contact-form-7 id=”762" title=”Feedback”]

31 thoughts on “Fix WordPress – An error occurred in the upload. Please try again later

  1. Sebastian Expert Post author

    (as in email)
    Could you send me a screenshot of the response (or lack of it)?
    Also can you send me a screenshot of “headers” tab?

    Sebastian

    Reply
  2. Ahsan

    I am having the same error i am too much stressed due to this error. Please tell me sollution of this problem.

    Regards
    Ahsan Ghias

    Reply
  3. Asad Ali

    Hi,

    I am using wordpress 4.2.5 and when I upload image and check the async-upload.php ajax call, the response returned from the server contains the links to uploaded image and all relevant details. However, it also contains the red error message as shown in your post. I believe no errors occur as file can be found on website as attachment and through direct link. Can you please suggest what the cause could be?

    Reply
    1. Sebastian Expert Post author

      image can be accessible after upload but if you get error message during upload some properties might not be set correctly. I will email you on the provided email address for further conversation.

      Reply
      1. Asad Ali

        Hi, sorry for late reply; was busy in the project.
        I have found the issue.The post I was editing was locked for edit by another user. So, while the image was successfully being uploaded, wordpress was unable to assign it to that particular post. After unlocking the post, everything worked fine.

        Thanks for your help and the above article was really helpful.

        Reply
  4. arnie wellah

    for me it was the image dimensions. I was attemping to upload images directly from my DSLR @ 5184 × 3456. I reduced the diments by 50% and bingo! uploads working

    Reply
  5. Robert

    I did what you suggested for the first problem (unable to upload). I am trying to upload an imahge frm my pc to my LOCAL database (using xampp and wordpress), The resulting error message is not clear at all, and is reported here. note: news_maxx_lite is the WP theme downloaded from wp site.
    The image I am trying to upload is only 120kB in size, so the size cannot be the issue. Can you help me?

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘news_maxx_lite_image_size_names_choose’ not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\plugin.php on line 235

    Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\wordpress\wp-includes\media.php on line 3099
    {“success”:true,”data”:{“id”:12,”title”:”sede”,”filename”:”sede-6.jpg”,”url”:”http:\/\/localhost:10080\/wordpress\/wp-content\/uploads\/2016\/03\/sede-6.jpg”,”link”:”http:\/\/localhost:10080\/wordpress\/sede-7\/”,”alt”:””,”author”:”1″,”description”:””,”caption”:””,”name”:”sede-7″,”status”:”inherit”,”uploadedTo”:0,”date”:1457105087000,”modified”:1457105087000,”menuOrder”:0,”mime”:”image\/jpeg”,”type”:”image”,”subtype”:”jpeg”,”icon”:”http:\/\/localhost:10080\/wordpress\/wp-includes\/images\/media\/default.png”,”dateFormatted”:”March 4, 2016″,”nonces”:{“update”:”3e43a4e019″,”delete”:”c2893a273d”,”edit”:”f4bf7964c8″},”editLink”:”http:\/\/localhost:10080\/wordpress\/wp-admin\/post.php?post=12&action=edit”,”meta”:false,”authorName”:”robert”,”filesizeInBytes”:121648,”filesizeHumanReadable”:”119 kB”,”sizes”:{“full”:{“url”:”http:\/\/localhost:10080\/wordpress\/wp-content\/uploads\/2016\/03\/sede-6.jpg”,”height”:635,”width”:960,”orientation”:”landscape”}},”height”:635,”width”:960,”orientation”:”landscape”,”compat”:{“item”:””,”meta”:””}}}

    Reply
    1. Sebastian Expert Post author

      hey,
      The JSON message states that the upload to WordPress was successful. What failed is a call that uses ‘news_maxx_lite_image_size_names_choose’ which was not found. You should contact theme developer and provide him with that logs.

      What you could do now is try to change theme to WordPress default and then back to news maxx lite. Disable all plugins and see if you get this error. If it does work then enable each plugin along with test if image can be uploaded.

      Sebastian

      Reply
  6. Leo

    Hi,
    I have the same issue as Joe, i get no response in the Network tab after an attempted upload.
    I have a successful POST call to async-upload.php but just no response
    Any ideas?
    Thanks

    Reply
    1. Sebastian Expert Post author

      hi, you would have to contact me using https://sebastian.expert/contact/ so we can try to figure out why you get no response. If there is no response you could try fiddler, but I think it will show you the same result. In case of any WordPress problem – disabling all plugins and setting temporally default template is a first step to diagnose a problem.

      Reply
  7. Adam Hodgson

    Hi Sebastian,

    Hope you’re well and thank you for putting the above together.

    I’ve recently moved my wordpress site from a personal hosting package to a business package due to lots of 404 errors (some issue with memory apparently).

    I’ve moved everything across but now images will not upload and I get the “An error occurred in the upload. Please try again later.” Error.

    Using your method above I get the following in the preview tab:

    404 {“success”:true,”data”:{“id”:5867,”title”:”sample-1″,”filename”:”sample-1-4.jpg”,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4.jpg”,”link”:”http:\/\/oldfieldparkinfants.co.uk\/2016\/04\/splish-splash-splosh\/sample-1-5\/”,”alt”:””,”author”:”5″,”description”:””,”caption”:””,”name”:”sample-1-5″,”status”:”inherit”,”uploadedTo”:5856,”date”:1461153095000,”modified”:1461153095000,”menuOrder”:0,”mime”:”image\/jpeg”,”type”:”image”,”subtype”:”jpeg”,”icon”:”http:\/\/oldfieldparkinfants.co.uk\/wp-includes\/images\/media\/default.png”,”dateFormatted”:”20th April 2016″,”nonces”:{“update”:”04d7acada2″,”delete”:”91514faf13″,”edit”:”4a0df2c14f”},”editLink”:”http:\/\/oldfieldparkinfants.co.uk\/wp-admin\/post.php?post=5867&action=edit”,”meta”:false,”authorName”:”Sophia Capetti”,”uploadedToLink”:”http:\/\/oldfieldparkinfants.co.uk\/wp-admin\/post.php?post=5856&action=edit”,”uploadedToTitle”:”Splish Splash Splosh!”,”filesizeInBytes”:32553,”filesizeHumanReadable”:”32 kB”,”sizes”:{“thumbnail”:{“height”:150,”width”:150,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4-150×150.jpg”,”orientation”:”landscape”},”medium”:{“height”:225,”width”:300,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4-300×225.jpg”,”orientation”:”landscape”},”full”:{“url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4.jpg”,”height”:315,”width”:420,”orientation”:”landscape”}},”height”:315,”width”:420,”orientation”:”landscape”,”compat”:{“item”:””,”meta”:””}}}

    The image looks successful in there even though it doesn’t upload. Also I’m not sure why there is a 404 still there.

    Hope you can help?!

    Many thanks,

    Adam

    Reply
  8. Frederick Thiele

    Hello,

    I get the error message that the image cannot be uploaded when an author tries to upload an image of 512px X 512px or smaller and under 10 kb.
    I tried all suggestions and even my host changed the php.ini settings to the max recommended settings:
    max_execution_time = 90
    max_input_time = 90
    max_input_vars = 3000
    memory_limit = 256M

    The file folder is 755.

    Is there a setting in the PhpMyAdmin that needs to be set? It was working before then all of a sudden it stopped.
    The error only happens when uploading on the front end of the Blog but not on the Question and Answers portion of my website.

    Regards,

    Fred

    Reply
    1. Sebastian Expert Post author

      hi, try to give the upload folder the 777 permissions (full) to test if upload works then. If so the permissions are the issue, if now we can move forward.

      Reply
  9. apurv

    Hi

    I followed all the steps written here. Post detecting async-upload.php then clicking on ‘Preview’ Tab it is showing ‘The request has no preview available.’

    What should be the solution to this problem?

    Reply
  10. David in Mississippi

    i get this error a LOT. As in every three days or so.

    My solution is to reboot my computer. It might work to restart the whole browser, but I haven’t tried that.

    Rebooting the computer works every time. Then I can upload images until the error rears its head again.

    David in Mississippi

    Reply
  11. CAMWP DEV

    Hi,
    We’re updating the table_prefix of the site and updating the database accordingly. However, we could not upload any files to the Media library anymore. We’ve tried several solutions listed above and also from different blogs, however, none of them are working. Is there any other points we’ve missed?
    Thanks for helping!

    Reply
  12. Emmanuel Ngapela

    Hello Sebastian
    I have the same error except that when I look with the web tool of Firefox there is nothing like error “nothing appears” in the tab “answer”

    Can you help me please?

    Reply
    1. Sebastian Expert Post author

      can you contact me using the ‘Contact’ form? I would need to see the screenshot of the Developers Tools with the response from your wordpress.

      Reply
  13. Mohan

    Hello,

    Help Me.. I am having same problem

    An error occurred in the upload. please try again later. wordpress

    Also Existing media files are not showing in the media library

    Reply
  14. Alexander

    If you have just moved your site to a different folder, then you need to change your folder structure in your settings under general. Save and then try again.

    Reply
  15. priya

    Hi Sebastian,

    Hope you’re well and thank you for putting the above together.

    I’ve recently moved my wordpress site from a personal hosting package to a business package due to lots of 404 errors (some issue with memory apparently).

    I’ve moved everything across but now images will not upload and I get the “An error occurred in the upload. Please try again later.” Error.

    Using your method above I get the following in the preview tab:

    404 {“success”:true,”data”:{“id”:5867,”title”:”sample-1″,”filename”:”sample-1-4.jpg”,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4.jpg”,”link”:”http:\/\/oldfieldparkinfants.co.uk\/2016\/04\/splish-splash-splosh\/sample-1-5\/”,”alt”:””,”author”:”5″,”description”:””,”caption”:””,”name”:”sample-1-5″,”status”:”inherit”,”uploadedTo”:5856,”date”:1461153095000,”modified”:1461153095000,”menuOrder”:0,”mime”:”image\/jpeg”,”type”:”image”,”subtype”:”jpeg”,”icon”:”http:\/\/oldfieldparkinfants.co.uk\/wp-includes\/images\/media\/default.png”,”dateFormatted”:”20th April 2016″,”nonces”:{“update”:”04d7acada2″,”delete”:”91514faf13″,”edit”:”4a0df2c14f”},”editLink”:”http:\/\/oldfieldparkinfants.co.uk\/wp-admin\/post.php?post=5867&action=edit”,”meta”:false,”authorName”:”Sophia Capetti”,”uploadedToLink”:”http:\/\/oldfieldparkinfants.co.uk\/wp-admin\/post.php?post=5856&action=edit”,”uploadedToTitle”:”Splish Splash Splosh!”,”filesizeInBytes”:32553,”filesizeHumanReadable”:”32 kB”,”sizes”:{“thumbnail”:{“height”:150,”width”:150,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4-150×150.jpg”,”orientation”:”landscape”},”medium”:{“height”:225,”width”:300,”url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4-300×225.jpg”,”orientation”:”landscape”},”full”:{“url”:”http:\/\/oldfieldparkinfants.co.uk\/wp-content\/uploads\/2016\/04\/sample-1-4.jpg”,”height”:315,”width”:420,”orientation”:”landscape”}},”height”:315,”width”:420,”orientation”:”landscape”,”compat”:{“item”:””,”meta”:””}}}

    The image looks successful in there even though it doesn’t upload. Also I’m not sure why there is a 404 still there.

    Hope you can help?!
    pls help me for these

    Reply
    1. Sebastian Expert Post author

      Sorry for the delay. First to do is to disable all the plugins and try again. You wrote that you moved wordpress, maybe there is a plugin which operates on images (like compressing) after upload which still has old configuration?

      Reply

Leave a Reply

Your email address will not be published.