Forgive me if there are existing nodes regarding this, I felt as though there would be , however a Super Search was unrevealing.

I am interested in the use of Apache::Request , specifically it's UPLOAD_HOOK callback. Having read some discussions about upload progress indicators here at the Monastery and abroad , it seems the consensus is to store some unique identifier server-side regarding the upload session, supply the calling browser with enough javascript to launch a window, calling /cgi/upload-status.pl with the initial unique identifier so it can stat the temporary file. So when the the request is created Apache::Request->new all the UPLOAD_HOOK callback can hope to achieve is to initialise the relationship (in a DB for example) between the present file upload location, and the unique upload identifier.

That makes even less sense to me having written it down..I will try point form

  1. Deliver upload form to client, containing uploadID (hidden field?), onSubmit() script that will launch a new window pointed at /cgi/uploadstatus.pl?uploadID=
  2. When the client submits the form, Apache::Request is configured to execute a callback (like a callback to a Tk event? a sub ref \&prep_for_upload) passing it the upload_tempfile and the uploadID.
  3. The submitee CGI carries on dealing with the multipart form data, writing it to the tempfile
  4. Meanwhile , /cgi/uploadstatus.pl is being refreshed every few seconds by the client, supplying each time the uploadID.
  5. Given the uploadID , uploadstatus.pl checks a DB for a corresponding entry, and outputs some sensible information regarding the status of the upload.

Have I totally mis-construed good advice, or is it really that complicated? I appreciate HTTP is stateless. Have any monks made this approach work?


I can't believe it's not psellchecked

In reply to Apache::Request UPLOAD_HOOK by submersible_toaster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.