Have an account? Sign in
Login  Register  Facebook
Permission denied after image upload
Hi Chaps,

I've got a image upload script that works on my Apache on IIS development server, but on the Apache Lunix live server, although the images are uploaded correctly and the MySQL database is updated correctly, I can't view the images.

Viewing the HTML source, checking both the FTP files and the database values, all look OK.

But the image doesn't show, just the white box with the red cross in the corner.

If I try to copy the shortcut of the image and open it in a seperate window, I get the following:


I'm not sure what to try next, it seems strange that the files/database/source look good but it just won't show!

I've tried both $HTTP_POST_FILES and $_FILES to upload the images, but both have the same result.
my code
$path1= "../../../../Images/Items/$prod_title/Shop_Thumb/".$HTTP_POST_FILES['ufile']['name'][0];
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
// Read and write for owner, read for everybody else
chmod($path1, 0644);
But this doesn't seem to work . . .?
If anyone has any ideas, please help!
Started: September 18, 2011 Latest Activity: September 18, 2011 php upload permission
1 Answer
what about using one of these classes
or ok first change the path to 777 then use this code instead of yours
$path1= "../../../../Images/Items/$prod_title/Shop_Thumb/";
move_uploaded_file($_FILES['tmp_name'],$path1.$_FILES['name'])

Posted: MacOS
In: September 18, 2011

Hi, thanks for the advice, changing the PHP to move_uploaded_file didn't work (the file didn't upload). . .would the classes work on the server I have?
September 18, 2011

i think these class will work with any php server; and please make sure from the html form
September 18, 2011

sorted it, chmod on folder and file to 0775
September 18, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer