Jump to content

Uploaded Images appear broken?


ILYAS415
Go to solution Solved by DFulg,

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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.