Avatar of Manoj Chacko
Manoj Chacko
 asked on

Wordpress Upload error

Trying to upload a file.
Gets error. “An error occurred in the upload. Please try again later.”

But looking at the backend look like upload works, but error is when its reading it back.

So basically it is having trouble reading the folder.
WordPressPHPWeb DevelopmentApache Web Server

Avatar of undefined
Last Comment
Manoj Chacko

8/22/2022 - Mon
Ray Paseur

Are you using a plug-in for the upload?  There are only a few recognizable upload errors.  In PHP you can detect these as shown here:
// ARRAY OF ERRORS THAT MAY BE REPORTED IN $_FILES[]["error"] (THERE IS NO #5)
$errors = array
( UPLOAD_ERR_OK         => "Success!"
, UPLOAD_ERR_INI_SIZE   => "The uploaded file exceeds the upload_max_filesize directive in php.ini"
, UPLOAD_ERR_FORM_SIZE  => "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"
, UPLOAD_ERR_PARTIAL    => "The uploaded file was only partially uploaded"
, UPLOAD_ERR_NO_FILE    => "No file was uploaded"
, 5                     => "UNDEFINED ERROR #5"
, UPLOAD_ERR_NO_TMP_DIR => "Missing a temporary folder"
, UPLOAD_ERR_CANT_WRITE => "Cannot write file to disk"
, UPLOAD_ERR_EXTENSION  => "A PHP extension stopped the file upload"
)
;

Open in new window

Manoj Chacko

ASKER
I am using the wordpress upload, not any plugins, not see any specific errors,
When I look from the backend the file does get uploaded, so I believe its trying to read part its crashing.

So when I go to dashboard Media I see that its thinking but does not show any existing file, and after uploading the file get uploaded but then gives this error

 “An error occurred in the upload. Please try again later.”
Manoj Chacko

ASKER
Looks like When Adding media through list works

Grid - does not work
Add media to page/post does not work
Add Avatar does not work
Your help has saved me hundreds of hours of internet surfing.
fblack61
Manoj Chacko

ASKER
It looks like something to do with javascript on the site,

Any idea how this can be fixed, It is a very critical issue
Terry Woods

Are you still having the issue?

There's a set of instructions for resolving the problem here, and they look thorough:
https://sebastian.expert/fix-wordpress-an-error-occurred-in-the-upload-please-try-again-later/

Let us know how you go.
ASKER CERTIFIED SOLUTION
Manoj Chacko

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.