Progress bar for a file upload

software development

#1

A few year’s ago, I managed to put together a simple Perl script with lots of help from members of this forum that lets users upload files to a directory to my website, files that might be too large to email. I wanted a one way file upload where the users wouldn’t be able to download or few other files in the directory, because sometimes the files are competitive bids or proposals. The Perl script lets users browse to find the file on their files system, and gives a completion message with the file size received.

However, recently I had some calls from people uploading their Power Point presentations for a conference we sponsored that were worried that nothing was happening. It turned out that they just had to wait a little longer to see the completion message. I thought it might be nice to add a upload progress bar or message to the script so the users will know that something is still working. What approaches to this are there? I suppose the simplest would advance a series of symbols across the page or make a spinner out of / - \ - / symbols that add a symbol for each x kbytes received. A trickier way would be to read in the size of the file to be sent somehow and compare that to the bytes received to get a percent received calculation to print to the web page.

Some of these approaches look more promising than others: http://www.google.com/search?q=Progress+bar,+Perl&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

It’s been a while since I’ve looked at perl, having gone more with php lately.

This signature line intentionally blank.


#2
  1. The upload script incrementally returns a document
  2. A second script is called that checks on the status of the upload script.

:cool: openvein.org -//-