I have following memory configuration with writable file name-
upload_max_filesize = 256M;
post_max_size = 256M;
memory_limit = 256M;
and form enctype="multi-part/form-data", permission to the folder is 777(tried with 755 and 644 to). Unfortunately could not figure out actual error -
if (move_uploaded_file($_FILES['async-upload']['tmp_name'], __DIR__.'/wp-content/uploads/'.$_FILES['async-upload']['name'])) {
echo "File is valid, and was successfully uploaded.\n";
} else {
// this always returns 0
echo $_FILES['async-upload']["error"];
}
What could be possible reason for upload failure and what i am missing here?
same code is working in another project?