Jump to content

Uploaded Images appear broken?


ILYAS415

Recommended Posts

Hi guys,

 

Basically I have a PHP script which uploads images and makes an SQL query. The script works perfectly, and the images are uploaded into a new directory created by the script. However, when I try to view the file directly though the browser, I get a 404 Page not found error. This is the same issue as when I try to link to the image with an img src tag.

 

I know that the image exists where it does because I can see the file and download it from my file manager. I have attached screenshots showing my predicament :)

 

Thanks.

 

post-40012-0-31185100-1379714838_thumb.png

 

 

post-40012-0-36703400-1379714845_thumb.png

Link to comment
https://forums.phpfreaks.com/topic/282329-uploaded-images-appear-broken/
Share on other sites

Found out that my directory permissions were a bit weird. The directory was not executable or readable apparently. This is the function that the script uses to create the directory:

mkdir("$desired_dir", 0700);

My question is simply, how can I make it so that when the directory is created, the permissions are already there so that other pages on my host can view the directory and its files?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.