Use the ColdFusion cffile tag to write a file to the server. You can use the CFFILE tag to write a text file based on dynamic content. ColdFusion would create a file named in the. Ron – Write is “create” – it makes a new file. Append is used to add data to an existing file on the disk. They are different actions. Try modifying your code as.
|Published (Last):||10 September 2009|
|PDF File Size:||1.75 Mb|
|ePub File Size:||11.96 Mb|
|Price:||Free* [*Free Regsitration Required]|
Ron Jensen 2 What are you looking at that makes you suspect permissions?
I’m getting a error from the webserver instead of a document. Try modifying your code as follows: Mark A Kruger 6, 15 Up vote for using cflock. Thanks Mark, it appears append will also create a file if it does not exist.
ColdFusion Help | FileWrite
My question was, is there a difference between append and write when they are used as the first cfgile that creates the file? That is, would the two files have different permissions. Or are you suggesting a timing issue may result from creating a new file with append?
I did not know that about append.
cffile action = “write”
I’ve always used “write” to create and append to add to a file so good to know – thanks! But yes, I’m suggesting that creating files and writing to them takes some care – and locking effectively serializes these two events. So there can be issues with releasing file handles. It’s better to avoid it.