Page 1 of 1

eh.. filesize

Posted: Fri Sep 02, 2005 11:36 pm
by s.dot
Its not possible to get the size of a file before it's uploaded to a tmp location is it?

Posted: Fri Sep 02, 2005 11:45 pm
by John Cartwright
Correct me if I'm wrong but the whole file has to be uploaded into memory before it can be read, so no.

Posted: Fri Sep 02, 2005 11:58 pm
by feyd
only through some Javascript/ActiveX/XPI magic could the size be determined.. not suggested to try however. ;)

Although, if you used Perl, you can get the headers about submission size, I believe. I remember a progress bar someone posted here a while back that needed Perl, but did upload progress..

Posted: Sat Sep 03, 2005 12:07 am
by s.dot
Eh, that's what I was going to try to write, feyd :P

I was bored.

I had some good logic though.

Get the size of the file before its uploaded (heh, right:P), poll the server for the size of the tmp file at specified intervals, divide currentsize by totalsize * 100 to get a percentage. Load an image and stretch the width to xx percent. Use javascript to refresh the progress bar at said specified intervals.

Meh, now that I know that's impossible, I'll give up :P. I'm sure someone's already thought of something along those lines... I almost felt smart for a minute.

Posted: Sat Sep 03, 2005 12:12 am
by feyd
viewtopic.php?t=23182
viewtopic.php?t=18889

were the ones I was thinking of... :)

Posted: Sat Sep 03, 2005 12:25 am
by josh
aaaaaaaaaaaaahh clone thread, viewtopic.php?p=198730#198730

Posted: Sat Sep 03, 2005 12:35 am
by s.dot
haha that first post is what got me thinking about trying to write one.

And I assure you, this thread was made before you posted your reply :lol:
I think anyways.

Posted: Sat Sep 03, 2005 11:25 am
by josh
scrotaye wrote:And I assure you, this thread was made before you posted your reply :lol:
I think anyways.
I beleive you, I was just posting that link instead of copy & pasting my response over to this thread