eh.. filesize

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

eh.. filesize

Post by s.dot »

Its not possible to get the size of a file before it's uploaded to a tmp location is it?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

viewtopic.php?t=23182
viewtopic.php?t=18889

were the ones I was thinking of... :)
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

aaaaaaaaaaaaahh clone thread, viewtopic.php?p=198730#198730
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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
Post Reply