raman Posted May 6, 2009 Share Posted May 6, 2009 I have a php script in which the user writes his files in the textbox or uploads a file. I have allowed upload or file writing in a subfolder within the main web directory /usr/local/apach2/htdocs/webdirectory Every time a user uses the form, a user directory is created within that subfolder and chmod 777 is executed on that user directory, the user file is written there. But I have to run a perl script on the file due to which I have to copy the file from that subdirectory to the main directory. Can someone tell me how I can give the user the permission to copy the file from that subfolder to main directory without doing 777 on the main web directory. Link to comment https://forums.phpfreaks.com/topic/157028-file-write-permissions/ Share on other sites More sharing options...
taith Posted May 6, 2009 Share Posted May 6, 2009 tell php to chmod() it 777, move file, then chmod() back Link to comment https://forums.phpfreaks.com/topic/157028-file-write-permissions/#findComment-827190 Share on other sites More sharing options...
raman Posted May 6, 2009 Author Share Posted May 6, 2009 tell php to chmod() it 777, move file, then chmod() back But is this not a security risk ? Link to comment https://forums.phpfreaks.com/topic/157028-file-write-permissions/#findComment-827214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.