I've been banging my head against the wall on this one. I have a system that allows a user to FTP a zip file to the server. Then in the admin they can tell the application where this file is so a set of actions can be performed on the file.
- Move the file out of the web root
- Unzip the file
- List the contents and insert data into database
Problem is, the file uploaded does not always have the proper permissions. I've tried changing them with the following:
<cfscript>
FileSetAccessMode(myFile, "777");
</cfscript>
And
<cffile action="rename" mode="777" source="#myFile#" destination="#myFile#">
And
<cffile action="move" mode="777" source="#myFile#" destination="#myFile#">
But nothing will change the permission of this zip file. Note that if I perform any of the above actions on an image (.jpg) it works fine. Am I missing something?
The FTP'd files are unlikely to be owned by the webserver process, unless you FTP in with the same credentials as the webserver's running under. Unless the webserver owns the files, it won't be able to change the permissions on them.