I have a multipart form I’ve just moved to a new server which uploads an image. It works perfectly on one, but not on the other. Regular form data works, but my php script to process the upload doesn’t acknowledge that there are any files.
ie:
if($_FILES['product_image'][name] != '') {
// store the image
}
It basically ignores this $_FILES variable as though it doesn’t exist.
I vaguely recall this issue happening in the past but I can’t remember what it was that solved it. Is there some configuration for apache setup, or something I am missing?
Here is a var_dump($_FILES) from the upload:
array(2) { [“product_image”]=> array(5) { [“name”]=> string(11)
“TEST.png” [“type”]=> string(9) “image/png” [“tmp_name”]=> string(14)
“/tmp/phpYP9AKA” [“error”]=> int(0) [“size”]=> int(38652) }
This is the critical part:
The upload failed with error code 4 – “No file was uploaded”.
Without seeing your form, there’s no way to diagnos this.