forumnz Posted May 11, 2007 Share Posted May 11, 2007 When a user uploads an image to a directory, it automatically chmods it to 0, I want 777... How can i do this automatically? Link to comment https://forums.phpfreaks.com/topic/50904-image-chmod/ Share on other sites More sharing options...
only one Posted May 11, 2007 Share Posted May 11, 2007 check this, it will explain it better than i can http://nl2.php.net/manual/en/function.chmod.php Link to comment https://forums.phpfreaks.com/topic/50904-image-chmod/#findComment-250361 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 Your quick only one chmod("/path/to/filename.jpg", 0777); Link to comment https://forums.phpfreaks.com/topic/50904-image-chmod/#findComment-250363 Share on other sites More sharing options...
forumnz Posted May 11, 2007 Author Share Posted May 11, 2007 Thanks but i want the images to automatically be 777 when uploaded. Link to comment https://forums.phpfreaks.com/topic/50904-image-chmod/#findComment-250364 Share on other sites More sharing options...
chronister Posted May 11, 2007 Share Posted May 11, 2007 You cannot chmod them until they are placed somewhere on the system. *I think*..... So place the chmod("/path/to/filename.jpg", 0777); directly after your move_uploaded_file() chunk, and replace the path with the path variable you moved it to including the $_FILES['field_name']['name'] If you need more help here, then post the upload script code ya got and we'll show ya where to put it so that it is dynamic and will automatically chmod the file once it is moved to the place you want it to go. Nate Link to comment https://forums.phpfreaks.com/topic/50904-image-chmod/#findComment-250370 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.