Click to See Complete Forum and Search --> : File upload


mioriticus
01-12-2001, 04:28 AM
Hi all,

I'm looking for a way of finding the size of a file before actually
uploading it.
I know I can check the size of the file on the server after the upload and
if it's too large acording to my criteria abort the rest of the operation,
but it would be nice to be able to make the check before wasting time and
bandwidth.

Thank you in advance,
Bogdan Ionita [NEKO]

Xin Li
01-14-2001, 01:41 AM
There is no cross browser way to do it, unless you write a Java Applet that
circumvents the "sandbox" (which may raise some eyebrows). Remember that
Java, and in fact ActiveX, was designed so that it cannot do bad things to
the users computer. Thus, some of the functions traditional programmers
take for granted, such as getting file sizes, are now much more difficult,
if not impossible.

Within IE though, assuming you are designing for a very specific audience,
you can use VBScript to do it by creating a FileSystemObject.

Look online for Referneces for how to use the FileSystemObject. This object
will allow you to run rampant on the user's hard drive, such as delete files,
copy, read file names and sizes.

Xin Li
"mioriticus" <neko@home.ro> wrote:
>Hi all,
>
>I'm looking for a way of finding the size of a file before actually
>uploading it.
>I know I can check the size of the file on the server after the upload and
>if it's too large acording to my criteria abort the rest of the operation,
>but it would be nice to be able to make the check before wasting time and
>bandwidth.
>
>Thank you in advance,
>Bogdan Ionita [NEKO]
>
>

neko
01-18-2001, 04:39 AM
Thank you.

--
Best regards,
Bogdan Ionita [NEKO]

"Xin Li" <xinli1@uiuc.edu> wrote in message news:3a614a0d$1@news.devx.com...
>
> There is no cross browser way to do it, unless you write a Java Applet
that
> circumvents the "sandbox" (which may raise some eyebrows). Remember that
> Java, and in fact ActiveX, was designed so that it cannot do bad things to
> the users computer. Thus, some of the functions traditional programmers
> take for granted, such as getting file sizes, are now much more difficult,
> if not impossible.
>
> Within IE though, assuming you are designing for a very specific audience,
> you can use VBScript to do it by creating a FileSystemObject.
>
> Look online for Referneces for how to use the FileSystemObject. This
object
> will allow you to run rampant on the user's hard drive, such as delete
files,
> copy, read file names and sizes.
>
> Xin Li
> "mioriticus" <neko@home.ro> wrote:
> >Hi all,
> >
> >I'm looking for a way of finding the size of a file before actually
> >uploading it.
> >I know I can check the size of the file on the server after the upload
and
> >if it's too large acording to my criteria abort the rest of the
operation,
> >but it would be nice to be able to make the check before wasting time and
> >bandwidth.
> >
> >Thank you in advance,
> >Bogdan Ionita [NEKO]
> >
> >
>