Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Actually, this can't be done with PHP, JavaScript, and HTML. The reason for this is because the PHP script doesn't have control over the file uploaded until it completes. The only solution that I know about is using a java applet to display a progress bar.
But, on the low end of the feature, you can always display some looping animation. (just like the auto complete, javascript upload feature, etc.)
I think the best approach would be to use the upload.module's js progress feature. The issue is not so much to accurately display the progress of the upload, but instead to do the upload post asynchronously instead of having to lock the page. This is particularly a problem for large uploads like mp3 tracks.
Comments
Comment #1
Michael M commentedActually, this can't be done with PHP, JavaScript, and HTML. The reason for this is because the PHP script doesn't have control over the file uploaded until it completes. The only solution that I know about is using a java applet to display a progress bar.
But, on the low end of the feature, you can always display some looping animation. (just like the auto complete, javascript upload feature, etc.)
Comment #2
zirafa commentedI've always wondered if we couldn't just use an ajax upload like the attachment module uses...would be nice I think.
Comment #3
anisotropic commentedI think the best approach would be to use the upload.module's js progress feature. The issue is not so much to accurately display the progress of the upload, but instead to do the upload post asynchronously instead of having to lock the page. This is particularly a problem for large uploads like mp3 tracks.