Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Ra: Ru: File upload progress?

by baku (Scribe)
on Feb 09, 2001 at 20:48 UTC ( #57407=note: print w/replies, xml ) Need Help??


in reply to (crazyinsomniac) Re: (2) (crazyinsomniac) Re: File upload progress?
in thread File upload progress?

Well, that's 99% true :-)

If you make the assumption that the user has JavaScript (but code for the case where they don't, as well!), you could open up a new, miniature browser window (with window.open) and set its URL to something like http://www.whatever.fu/upload/upload-status?id=xxx with an HTTP Refresh: header in that script. If you refresh every 3-5 seconds, you could display a 'status bar' and/or percentage/number of bytes/transfer speed...

Just link the JavaScript to the form's submit button. (Sorry, my E-262's really rusty or I'd try to offer some sample code, but I'd probably do more harm than good in this case! :-) ) -- I forget which way it goes, but if you return (true | false ? ) from your window.open call in the onClick (?) handler, the form won't submit, but run your code instead, so make sure to RTFM :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://57407]
help
Chatterbox?
[ambrus]: Corion: schmorp points out https://metacpan. org/pod/release/ KARASIK/Prima-1. 49/pod/Prima/File. pod,
[ambrus]: so there's an IO waiter (Prima::File) and a timer (Prima::Timer) maybe it's possible to write an AnyEvent loop driver over it, a saner one than POE

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2016-12-07 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.