I wrote:

> How do I get a file's size from the server?
>
> Is CFDIRECTORY with the List action the way to do it, or is there a more
> efficient/direct way to get a file's size?

To clarify, I'm trying to get a list of file sizes from the server (not
after they've been uploaded by the user). Using CFDIRECTORY and CFLOOP, I
could get a list of results into an array, but it seems rather inefficient.

Also tried using CFFILE:

<cfset thisDir=getDirectoryFromPath(expandPath("*.*"))>
<cfset f=thisDir&"tmpfile.dcr">
<cfoutput>The file path is: #f#</cfoutput><br>
<cffile action="READBINARY" file="#f#" variable="binObj">
The file size is: <cfoutput>#File.FileSize#</cfoutput><br>

... but got the following error:

--
An error occurred while evaluating the expression:
#File.FileSize#
Error near line 31, column 30.
----------------------------------------------------------------------------
----
Error resolving parameter FILE.FILESIZE
Before you can access any file status variables you must execute at least
one CFFILE tag.
--

Anyone know what's going on here? The FileSize status variable of the File
object should work with all CFFILE operations, no?


Dave Yang - Quantumwave Interactive Inc.
Toronto, Ontario, Canada
http://www.quantumwave.com

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to