Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting filesize 1

Status
Not open for further replies.

redshadow

Programmer
Joined
May 24, 2001
Messages
70
Location
PH
I want to make a dynamic website. When the user uploads a file, a link to this file is provided and I want to include in the link info its file size.

Can it be done in coldfusion or I have to make it the other way. Anybody can give me a tip on how to do it or link me to a site that has info about this?
 
Look into <CFFILE> using the UPLOAD action

<CFFILE ACTION=&quot;Upload&quot;
FILEFIELD=&quot;FORM.File&quot;
DESTINATION=&quot;c:\web\uploads\&quot;
NAMECONFLICT=&quot;myNewFile&quot;>


<CFOUTPUT>
#myNewFile.FileSize#
</CFOUTPUT> - tleish
 
If you want to limit the file size that is being uploaded, you can access that data from CGI variables.

<CFIF CGI_CONTENT_LENGTH GT 10000>file to large</CFIF>

This would prevent files larger than 10k to be uploaded to your server. If you just want to see what was uploaded see previous post.

Later!
 


oops.


<CFIF CGI.CONTENT_LENGTH GT 10000>file to large</CFIF>

 
I see. I look so stupid looking for java functions. I haven't seen them from the cf docs maybe I've skipped them.

Thanks people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top