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:

forbidden you don’t have permission to access [image path]

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.

If anyone has any ideas, please help!

The documentation elaborates sufficiently, let us know if you get stuck on a particular issue though.

Hi, I’ve changed it to:

mkdir("Images/Items/$prod_title/Shop_Thumb/");
$path1= "Images/Items/$prod_title/Shop_Thumb/".$HTTP_POST_FILES['ufile']['name'][0];
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
chmod($path1, 0777);

the permission now reads:

-rwxrwxrwx

But still not working
Any ideas?

Check the file permissions, chances are you’ll need to [fphp]chmod[/fphp] 'em for Apache.

OK cool,
just as a starting point, do I have to set the chmod before I upload, or can I change the permission retrospectively?
Cheers

OK, think I might need some help. This is my code,

mkdir("Images/Items/$prod_title/Shop_Thumb/");
$path1= "Images/Items/$prod_title/Shop_Thumb/".$HTTP_POST_FILES['ufile']['name'][0];
copy($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
chmod($path1, 0755)

But this doesn’t work.
I’ve checked the uploaded file permissions with Filezilla and it shows as:

-rw-r–r–

Any ideas?

How do I do that?

sorted, chmod on folder and file to 0775