ColdFusion 8: Setting a New Trend in File Operations
page 1 of 3
Published: 16 Oct 2007
Abstract
In this article Debjani provides a brief description of the new features added to ColdFusion 8 regarding file operations with examples and also discusses the upgrades to the functionality of file operations in ColdFusion 8 as compared to Coldfusion 7.
by Debjani Mallick
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 17096/ 21
Article Contents:

Introduction

ColdFusion 8 has given a new definition to file operations as compared to ColdFusion 7. In ColdFusion 7, cffile is the tag responsible for handling all file operations (for reading a file, for appending data to a file content, to write to a file and other operations). Though cffile is able to give justification to its work, there are some places or situations which cffile fails to perform perfectly. Lets us consider the first situation where we have two files – one file is of size of only some kb and the other one is some 100 kb bigger the first file. For performing file operations on the first file, the cffile tag works fine, but when it comes to the second case where the file size is bigger, it may not perform perfectly. This is because cffile tag can perform operations at a single shot only. So for reading or writing, we need to read data at one time or provide the whole content at one shot, i.e. the whole content needs to be kept in memory.

When the file size is bigger it can create a burden on the server and if the load is very high, it can lead to OutOfMemory error on the server. It would also lead to slow down in performance of the server as it is required to allocate and deallocate larger part of memory which would lead to more frequent garbage collection cycles. One more demerit with cffile is that it cannot be used within cfscript as cfscript does not support ColdFusion tags. So to perform file operations within a script we need to wind up all the required instructions in a function and call that function within the script. Keeping these problems in mind, in ColdFusion 8 a number of functions have been added to address these disadvantages.


View Entire Article

User Comments

Title: Thanks   
Name: Chaz
Date: 2009-10-06 11:33:02 AM
Comment:
Thanks. Helped me out.
Title: test for path   
Name: Paul
Date: 2008-05-07 7:00:07 AM
Comment:
How do you test whether a PATH exists or not? not the destination file itself (e.g. index.cfm), but the path to the destination file where you want to upload to (e.g wwwroot/sites/site2/).
Title: errors   
Name: Paul
Date: 2008-05-06 5:59:08 AM
Comment:
Missing braces in Listing 16
Title: Nice one   
Name: Ritesh
Date: 2007-10-20 9:03:22 AM
Comment:
Nice article on CF8

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 3:47:03 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search