Making folder writable to PHP.
Posted: Thu Apr 17, 2008 2:42 am
Hello,
I have a script online use to generate a zip file and write it in a folder e.g.: admin/export.
I believe changing export folder to writable permission globally is not advisable because any user can modify or can delete the files.
I came up in a scenario. First, leave the folder in read only mode. Second, before writing a file (using php file system functions) in the folder change the permission to writable. Lastly, after writing the file to the folder restore the folder permission to read only again.
Right now I have a problem with this method. I cannot write file to the export folder. I believe the cause of the error is the folder is still in read only mode.
Can anyone help me to solve this issue? Do anyone has different approach?
Many Thanks!
Jess
I have a script online use to generate a zip file and write it in a folder e.g.: admin/export.
I believe changing export folder to writable permission globally is not advisable because any user can modify or can delete the files.
I came up in a scenario. First, leave the folder in read only mode. Second, before writing a file (using php file system functions) in the folder change the permission to writable. Lastly, after writing the file to the folder restore the folder permission to read only again.
Right now I have a problem with this method. I cannot write file to the export folder. I believe the cause of the error is the folder is still in read only mode.
Can anyone help me to solve this issue? Do anyone has different approach?
Many Thanks!
Jess