It should be mentioned that there is a function on cflib.org that will calculate the proper file size (ie, MB,GB,K) for you, to make display oh-so-purdy.
I don't have the exact name or link, but a quick search at the site should bring it up. On 10/4/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > Nevermind the last post. I figured it out, It's the decimalformat() > function. > > Thanks again all! > > On 10/4/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > I should have known that I was going to have to do some math on the > > file size returned by cfdirectory... > > > > I have this: > > <cfset size = audiofile.size/1048576 /> > > Which gives me 8.26320075989 > > > > How do I round that number to just 8.26? > > > > -Aaron > > > > On 10/4/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > > Thanks everyone. Believe it or not, all of that explaining was > > > necessary. I didn't realize cffile read the file into memory and the > > > rest. > > > > > > -Aaron > > > > > > On 10/4/06, Ray Champagne <[EMAIL PROTECTED]> wrote: > > > > Oh yea. Duh. Disregard my post. :) > > > > > > > > > -----Original Message----- > > > > > From: Jerry Johnson [mailto:[EMAIL PROTECTED] > > > > > Sent: Wednesday, October 04, 2006 6:40 PM > > > > > To: CF-Talk > > > > > Subject: Re: How to get file sizes dynamically? > > > > > > > > > > cffile will read the entire file into a memory variable. which > with an > > > > > mp3 file will bring your server to its knees. > > > > > > > > > > cfdirectory will just get a list of files, and some of the files > > > > > properties (size, type, datelastmodified, name). > > > > > > > > > > Definitely use cfdirectory. > > > > > > > > > > > > > > > On 10/4/06, Aaron Roberson <[EMAIL PROTECTED]> wrote: > > > > > > I was doing a search through cfQuickDocs and found <cffile /> > Should I > > > > > > use <cfdirectory /> or <cffile />? > > > > > > > > > > > > In a search I did on cffile I somebody suggested the following: > > > > > > > > > > > > <CFFILE ACTION="Read" Variable="MyFile" file="myfile.ext"> > > > > > > > > > > > > File Size: <cfoutput>#Len(MyFile)#</cfoutput> > > > > > > > > > > > > Thanks again, > > > > > > Aaron > > > > > > > > > > > > On 10/4/06, Matt Quackenbush <[EMAIL PROTECTED]> wrote: > > > > > > > <cfdirectory action="list"> will return a query containing all > the > > > > info you > > > > > > > want. > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Aaron Roberson [mailto:[EMAIL PROTECTED] > > > > > > > Sent: Wednesday, October 04, 2006 5:08 PM > > > > > > > To: CF-Talk > > > > > > > Subject: How to get file sizes dynamically? > > > > > > > > > > > > > > I have a list of mp3 files that I am making available for > download on > > > > my > > > > > > > website and would like to indicate what the file size of each > mp3 is. > > > > > > > > > > > > > > How can I do this programmaticly? > > > > > > > > > > > > > > Thanks for the help! > > > > > > > Aaron > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255581 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4