Dynamic File Permissions

XXXconanXXX

Cocktails anyone?
Reaction score
284
Okay, so here's the situation:

I have an image which I dynamically upload to from a Java servlet. I have a PHP script that uses mkdir() to make a directory on the site, which the servlet uploads the photos to. They upload fine, but when I go to view them on the site, they don't show? I can't view the file folder from a browser which is ideal, but either way I need to be able to view them from the site so the user can view the photos.

I've tried changing read/write permissions for the top-level directory from my server's cPanel, but still no go.

Any ideas? I hear the mkdir() permissions are ignored on Windows platforms, what does that mean? It's fine if the user can view the photo directory and download the images, but no matter how I tinker with the permissions server-side or in the script they're still unviewable. I tried even making the site directory read-only to everyone, and still no go.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
What user/group owns the pictures when they are uploaded? What file permissions are set on them? If you manually create a file in the same directory, can you view it?
 

XXXconanXXX

Cocktails anyone?
Reaction score
284
Technically all I'm doing is displaying photos from a photo directory when they log in to their gallery. The photo directories are dynamically created, so I created another directory to put them all in and set permission to read for user/group/world. When I call mkdir() I've got the permissions set to 0777. I tried going in and changing the permissions for the directories manually and still no luck.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Who owns the files and the parent directories? Is the user under which the webserver runs able to access the directories from a shell?
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
You could make a folder unreadable by world and use php's readfile() along with header() to output the images when someone's allowed to view them.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top