Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing before long uploading in cgi

Status
Not open for further replies.

mmfried

Programmer
Sep 17, 2003
33
IL
Hello,

I am doing an upload i my cgi program.
there might be some long uploads so i want to show a nice waiting gif while waiting to the upoad to finish.

I tried to set the $| to 1 but it didn't work - the gif shows only after the upload finishes.

what should i do?
 
This will always be the case with standard CGI. When you do a FILE upload in CGI the upload is transmitted first before any other activity can happen.

The way I get around this is to upload to a different window. Then using javascript you can background that window and redirect the front window to a nice 'progress bar'. When the upload finishes the 'back window' refreshes and has javascript to redirect the front window and close itself out.

Alternatively you can use javscript to pop-open a window that is the 'progress animation' and keep your upload in the primary window. When the upload finishes the primary window loads with javascript to close the 'animation pop-up' you opened using javascript.

The reason this works is that javascript can intercept the onClick event, do some actions and then do a form.submit() to start the upload action.

The only way I know to truly do what you are trying to do is using Mod_Perl and Apache::UploadMeter but I have never been successful with it.

Hope this helps.
 
Thanks siberian. I'll use the JS way after all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top