I performed your standard checks (is there a directory there, fairly weak permissions are set), and I'm sure I covered your standard stupid human tricks. Here's the code that doesn't work:
move_uploaded_file($_FILES['image1']['tmp_name'], "/public_html/flashsale/assets/img/products/T".$_FILES['image1']['name']);
There is a directory - I copied the path from FileZilla. I even set the permissions to 777 , both in FileZilla and in the file manager on the HostGator control panel. This code generates two warnings:
Message: move_uploaded_file (/public_html/flashsale/assets/img/products/Tsirloin.jpg) [function.move-uploaded-file]: could not open the stream: there is no such file or directory
Message: move_uploaded_file () [function.move-uploaded-file]: cannot execute move '/ tmp / phpI5GZ3S' to '/public_html/flashsale/assets/img/products/Tsirloin.jpg'
In that order. So, the file is uploaded, the directory exists and is set to 777, what else can I lose?
php file-upload
Fibericon
source share