<CFFILE> Tag - ColdFusion


>> Return to ColdFusion Tag Index

The <CFFILE> tag allows you ...



  <CFFILE> Comments from Macromedia LiveDocsLiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
cffile is a dog for doing appends and writing large files. Using native Java is much faster. I use the <a href="http://cfthishelps.blogspot.com/2005/09/writing-large-output-files-with.html">ColdFusion Java FileWriter.cfc</a>.

Here are some other <a href="http://www.informationsavvy.com/coldfusion/">other useful ColdFusion Java CFCs for file and string operations</a>.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
The true problem with the documentation is that people never use the arrows. PHP (http://www.php.net) does their documentation perfectly fine without requiring users to click on arrows to move to a new page. I propose that the documentation be placed on one page for each function. If Macromedia likes, they can use html links within a page, like http://www.mypage.com#myLink

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
I disagree with your sentiments mydognacho. Try clicking links - click on 'cffile action = "upload"' link above to see file parameters. You need to use the 'cffile' prefix rather than just 'file' now.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
I have GOT to be expressing the feelings of many users in saying that liveDocs is completely worthless. I have the ColdFusion 5 language reference book put out by Macromedia. I'm looking in the book under CFFILE and it says that a valid object variable for CFFILE is FILE.CONTENTTYPE. I attempt to use this in CFMX 6.1 and get the error "Element CONTENTTYPE is undefined in FILE. ".

Fine...so I come to LiveDocs to search for the correct answer and DO NOT even find a list of FILE object variables.

This should be the FIRST thing you focus on Macromedia. Either that or put out a language reference book for version 6 or version 7 so that I don't have to waste my time coming to LiveDocs only to find nothing on my search.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
It seems to me that cffile is a very slow asynchronous function. I cannot perform two cffile actions one right after the other except in the case of read, write and append.

For example, I cannot use action="upload" on a file then action="copy " right afterwards.

Why? This is very dumb behaviour. We were having the same problem with cf4.5 and cf5.0. Is it because the file is left open?

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
This currently read: "Changed behavior for action="upload" nameConflict="MakeUnique" ColdFusion now makes filenames unique by appending a incrementing number, 1 for the first file, 2 for the second and so on, to the name. In ColdFusion MX filenames were made unique by appending an additional "1" for each file, as in 1, 11, 111, and so on."

I believer it should read: "Changed behavior for action="upload" nameConflict="MakeUnique" ColdFusion MX now makes filenames unique by appending a incrementing number, 1 for the first file, 2 for the second and so on, to the name. In older version of ColdFusion, filenames were made unique by appending an additional "1" for each file, as in 1, 11, 111, and so on."

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
Is the cffile "global" scope thread-safe in a persistant cfc enviroment or do you need to instantiate a new Input/Output object to maintain thread-safety?

You cannot "var" cffile to create a private variable at the begining of your method. After calling <cffile ...> is it sufficient to dupCffile = duplicate(cffile) to return at the end of the method?

Would it be thread-safe, if you temporarily instiantiate a new Input/Output cfc into the private scope (by var) in an persistant scope CFC in which your I/O would be gone when the method that called it was finished?

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
csteinola - In CF 5 there was a page called "Tag Restriction" in the CF Admin where you needed to make sure that this tag was enabled for it to be used. In CFMX 6.1 there is no tag restriction page and only if you use Sandbox Security will this tag be restricted. This note is an abreviated version from the CF 5 docs.

I found this line confusing because - I read this line - This tag executes only if it is enabled in the ColdFusion Administrator -
AND interpreted it as
"I need to check some setting in the CFMX 6.1 admin before using cffile to make sure that it's enabled like I did in CF 5 . So when I went into the CF Admin to look for the setting I'm like what the hay where is that setting?"

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
"To restrict this tag in CFMX use Sandbox Security"

... which you set up via CF Administrator, according to the [i]Configuring and Administering ColdFusion MX[/i] documentation.

I don't see the distinction you're trying to make, lbryngel. The note seems quite accurate to me.

LiveDocs Comments - coldfusion - 6.1 - htmldocs - tags-p27.htm
REMOVE NOTE:
"Note: This tag executes only if it is enabled in the ColdFusion Administrator. For more information, see Configuring and Administering ColdFusion MX."

The "Tag Restriction" page is not in CFMX 6.x Adminstrator - it was only in CF 5. To restrict this tag in CFMX use Sandbox Security.



[Top]


Recommended Books

[Top]

Web Sites

[Top]

Copyright © 2003- 2008, Orville Paul Chomer, All Rights Reserved