[SOLVED]Setting Upload File Permissions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

[SOLVED]Setting Upload File Permissions

Post by blacksnday »

In the following example of a image upload, how do I make it so that
when the tmp is place in the upload folder, the file permissions are
777? Right now it uploads with the permssions being at 600

Code: Select all

move_uploaded_file($_FILES['image']['tmp_name'], $uploads.'/'.$_FILES['image']['name'])
   or die ("Couldn't upload ".$_FILES['image']['name']."\n");
Last edited by blacksnday on Wed Aug 24, 2005 7:00 am, edited 1 time in total.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

chmod($uploads.'/'.$_FILES['image']['name'], 0777);
User avatar
blacksnday
Forum Contributor
Posts: 252
Joined: Sat Jul 30, 2005 6:11 am
Location: bfe Ohio :(

Post by blacksnday »

thanks :)
works like a charm
Post Reply