Reply to topic
Permissions skewed when uploading files through PHP
cheryl


Joined: 17 Apr 2004
Posts: 84
Location: Newark, DE
Reply with quote
Hey everyone!
I have been doing some testing with uploading files in PHP and have found some good suggestions to override the default umask and ensure your files are viewable on the web. You can try changing your umask to by inserting the code:
umask (0);
in your script before the call to the upload in PHP.
You can also run the chmod function after the upload to set the permissions to whatever you want:
chmod ("yourfile", permissions);
such as chmod ("/images/newimage.jpg", 644);
You can find more information on chmod at http://us2.php.net/chmod
dan
HostMySite Tech

Joined: 07 Mar 2004
Posts: 42
Location: Newark, Delaware
Reply with quote
You can also use the Umask option to set PHP's Umask and have that used for when the files or directories are created:

http://us2.php.net/umask
Permissions skewed when uploading files through PHP
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic