Mark:
 
If you are talking about a user uploading a file to your website from their
desktop - no  - there is no way to do it that I am aware of.  Anything on
the client side would need access to the file system.  Browsers are not
allowed to do that.  Maybe you could do it with Java if the program was
signed and the user chose to trust it?
 
If you are moving a file from one server or folder to another you can use
the getFileInfo function to check the size before you move it.
 
I will be happy to be wrong if someone knows better as I would love to be
able to check a file size before upload.
 
Cheers
 
I found this online - was checking to make sure my knowledge wasn't
outdated. :-)  Sounds like it might have possibilities.
 
About the Javascript...there *is* a trick I have used to check the file size
of a file, but it requires the user to load it locally. 

You basically create a new Image object with that file name the same way you
do with image pre-loaders and check the size property of the Image object. I
have used it to get file sizes of images and audio files, but it should work
with other types as well. 


If I remember right, the Image object loading is asynchronous, so you might
need to define an onload function that will be called when the file is
actually loaded. 

 
Shane Heasley
www.CTek-Media.com 

  _____  

From: [email protected] [mailto:[email protected]] On Behalf
Of [email protected]
Sent: Thursday, January 07, 2010 1:01 PM
To: Abridged Recipients
Subject: [houcfug] Abridged summary of [email protected] - 1 Message
in 1 Topic


  Today's Topic Summary

Group: http://groups.google.com/group/houcfug/topics

*       checking file upload size client side <>  [1 Update] 

 Topic: checking file upload size client side
<http://groups.google.com/group/houcfug/t/e88814a5fab56cdd> 

        "Mark Davis" <[email protected]> Jan 07 10:46AM -0600 ^ <> 
 
does anyone know of a way to check and limit file upload size prior to the
web server uploading the file? I'd rather not upload a 10 MB image file to
my server only to then realize its too big.
more... <http://groups.google.com/group/houcfug/msg/b431f8ca1d58fbf2> 


No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.432 / Virus Database: 270.14.129/2605 - Release Date: 01/07/10
07:35:00


-- 
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en

Reply via email to