http://www.perlmonks.org?node_id=234801


in reply to Re: Re: (nrd) Executing Perl Script from a Web Page
in thread Executing Perl Script from a Web Page

This depends on a few things... but, you could have a Perl script that watches the file upload by how much of the file is uploaded so far. You can steal the size of the file from the Content-size: header, pass it to the second script as a query string, and have the script return a page with a meta refresh tag so the page will reload every second or so.

That's putting more strain on the server; how important is it to have a window display the current upload?

John J Reiser
newrisedesigns.com

  • Comment on Re: Re: Re: (nrd) Executing Perl Script from a Web Page

Replies are listed 'Best First'.
Re: Re: Re: Re: (nrd) Executing Perl Script from a Web Page
by Eoin Redmond (Novice) on Feb 13, 2003 at 12:20 UTC

    Thanks John

    I actually went down the route you suggested using a little more javascript then you mentioned. Again I ran into the problem that the upload file wasn't actully written out on the server until the entire file had been upload

    Obviously the process is storing the chunks of uploaded data in a temp file or cache until everything has been uploaded so my second Perl script has nothing to report on until the file is finally uploaded which, of course, is too late

    Just about to give up on this approach and simply have my second Perl script just display a file uploading message and exit when the file has been uploaded

    Unless you can access the data as its being uploaded then this approach won't work. Still, I learned a lot of stuff trying it out

    Thanks

    Eoin