[Javascript] Getting the file size

dev at qroute.net dev at qroute.net
Fri Sep 17 18:16:53 CDT 2004


For images, that's np problem. I can get the file size before the upload
takes place and reject it right before the costly upload.
All you do is to load the 'browse'd file path into an img tag and get to its
filesize property through the src.
But there is no other tag that I can try for doing the same for an audio or
video file.

----- Original Message ----- 
From: "Hakan M (Backbase)" <hakan at backbase.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Thursday, September 02, 2004 1:22 AM
Subject: Re: [Javascript] Getting the file size


> If you mean getting the size of a file specified in a fileupload form
> element, there is as far as I know no way of doing this client side.
> What you can do is check the post data on the server, look for the
> Content-length header (or something along those lines) and determine if
> it's too big/not big enough.
>
> Regards,
> H
>
> dev at qroute.net wrote:
> > How do you get the file size of an mpeg file so before upload it can be
> > validated ?
> >
> > Looks like filesize is the right property to get to the info but how do
you
> > run it ?
> > Thank you
> >
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> >
> >
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>




More information about the Javascript mailing list