I am using and getting a file from ftp server. But when I use to read the downloaded file, its not allowing me to read the file. Its because of the permissions on the files.
How can i set permission to 777 or full access for that fi开发者_JS百科le from code. I don't want to do that manually. I am using Mac OS. Thanks..
For setting permissions on a file in ColdFusion use the optional mode attribute of cffile with the octal values of UNIX chmod command.
<cffile action="write" destination="#fileToWrite#" mode=777>
This applies to Unix/Linux only.
If this is about files uploaded to your server and you have access to your ftp admin / config files, then you probably would want to modify the upload mask to adjust permissions of the files uploaded.
If you download the files yourself manually, then you would have to put it in a folder where coldfusion at least has read access, or tell your ftp client to store the file accessible for cf.
You can write permissions using CFFILE. I don't think there is a way to do only that, but you could do it as part of a rename or move operation. Check the docs for more specifics on it.
精彩评论