Gossamer Forum
Home : General : Internet Technologies :

File Uploading with a Dynamic Progress Bar Possible?

Quote Reply
File Uploading with a Dynamic Progress Bar Possible?
Hi,

Just saw the Dynamic Progress Bar at dynamicdrive.com and started wondering about the following:

At our website we have a page where people can apply for a job. They need to fill in their name, address, and so on. Plus upload their resume! Because the uploading could take long I made a script (code available on request) hat will displays the following div on the moment the user presses the "Submit" button.

It's a dutch message saying that the uploading can take some take and asking them to please be patient.

Code:
<div id="notify" style="font-family: Verdana, Arial, Helvetica; font-size: 11px;

text-align: left; color: #000000; background-color: #ffffff; border: 3px solid

#ff0000; padding: 3px; position: relative; visibility: hidden;">Het uploaden van

uw bijlage kan enige tijd inbeslag nemen (afhankelijk van de omvang), een moment

geduld alstublieft.</div>

But what about if I could make a Dynamic Progress Bar that actually would display how long the uploading will take. For this it should be able to interact with the upload-script to determine how long the uploading will take. Or it should be able to calculate (with javascript) how bog the file being uploaded actually is. Wouldn't that be cool?

So my question is:

Who knows a way of calculating how big the selected uploading-file is? (The next step would be converting to seconds or minutes.)


Last edited by:

cK: May 26, 2002, 9:59 AM
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
You can't grab the file size using javascript/dhtml.
Quote Reply
Re: [Paul] File Uploading with a Dynamic Progress Bar Possible? In reply to
I know, but was thinking that maybe there some 'solution' to implement a Dynamic Progress Bar!

Others? Ideas/cheats?
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
Just received the following error when posting:


A fatal error has occurred:
GT::Mail::Send (13116): No To: field specified. at /home/gossamer-threads/perl/gforum/admin/GT/Mail/Send.pm line 166.


Please enable debugging in setup for more details.




GT?
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
In Reply To:
Just received the following error when posting:


A fatal error has occurred:
GT::Mail::Send (13116): No To: field specified. at /home/gossamer-threads/perl/gforum/admin/GT/Mail/Send.pm line 166.


Please enable debugging in setup for more details.




GT?

Yup, its a problem with GT Forum at the moment. They should be looking into it.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Paul] File Uploading with a Dynamic Progress Bar Possible? In reply to
You can get the file size through javascript. This is an Internet Explorer only feature.

See attached file for an example.

Thanks

Kode
Quote Reply
Re: [kode] File Uploading with a Dynamic Progress Bar Possible? In reply to
Yes but thats the html file size, not the _uploaded_ file size.

Last edited by:

Paul: May 29, 2002, 10:27 AM
Quote Reply
Re: [Paul] File Uploading with a Dynamic Progress Bar Possible? In reply to
Okay try the attached html file for Internet Explorer only.

Thanks

Kode
Quote Reply
Re: [kode] File Uploading with a Dynamic Progress Bar Possible? In reply to
Hey thats pretty cool...didn't know you could do that. Not sure about the ActiveX prompt though :(
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
I had a quick look for a free upload progress bar.

Found one at http://support.persits.com/upload/progress.asp

On this page you can see how it works and also download the code.

Note this example is for Active Server Pages.

Have a look.

Thanks

Kode
Quote Reply
Re: [kode] File Uploading with a Dynamic Progress Bar Possible? In reply to
Yeah, that progress bar is very very cool ! Too bad, it's .asp Frown

It would be nice if there yould be a general javascript or perl way. Wink
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
I'd brush up on your client-server application knowledge.

Did ya even look in the SOURCE CODE???

Quote:

<SCRIPT LANGUAGE="JavaScript">

function ShowProgress()
{
strAppVersion = navigator.appVersion;
if (document.MyForm.FILE1.value != "" || document.MyForm.FILE2.value != "" || document.MyForm.FILE3.value != "")
{
if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
{
winstyle = "dialogWidth=375px; dialogHeight:130px; center:yes";
window.showModelessDialog('framebar.asp?to=10&PID=81D4993649DB5BC9&b=IE',null,winstyle);
}
else
{
window.open('framebar.asp?to=10&PID=81D4993649DB5BC9&b=NN','','width=370,height=115', true);
}
}
return true;
}

</SCRIPT>


Hmm...[scratches chin]...me thinks that is javascript...client-side programming, buddy. Wink
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] File Uploading with a Dynamic Progress Bar Possible? In reply to
Mmm I hate to rain on your parade but all that code does is load a different asp page depending on the browser Wink
Quote Reply
Re: [Paul] File Uploading with a Dynamic Progress Bar Possible? In reply to
Ain't raining on my parade...fact is that the javascript shows a progress bar and it's javascript, ain't ASP. See ya.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] File Uploading with a Dynamic Progress Bar Possible? In reply to
Look closely at the code, it doesn't show a progress bar, it loads an asp page.
Quote Reply
Re: [Paul] File Uploading with a Dynamic Progress Bar Possible? In reply to
You're correct.

Sorry OB1TheGodofProgrammer! MadTongue

HOWEVER, the javascript codes posted will give the user a head-start...don't ya think, devil's advocate! Mad
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] File Uploading with a Dynamic Progress Bar Possible? In reply to
In Reply To:
HOWEVER, the javascript codes posted will give the user a head-start...


Making a pop-up to show a progress bar isn't too difficult. As you said: It's just javascript and cut-and-past work. But the true problem is making the progress bar show the 'real progress'. And THATS based on asp-technology. Till some perl-kids come up with something new! Wink
Quote Reply
Re: [cK] File Uploading with a Dynamic Progress Bar Possible? In reply to
I'm also searching for a progress bar that works with a form w/autoresponder. I have a working form with file uploader that sends a message to me and the client with details of the upload BUT I need a progress bar. This is all cgi and it works great because I can have clients upload big files (max 100mb). I have found a progress bar cgi but can't seem to get it to work with my form. Here's the progress bar: http://www.raditha.com/megaupload/perl.php
And here is the form cgi that I'm using: http://www.mycgiscripts.com/file-uploader.html

If anyone can marry the two I'd be greatful beyond belief.
Thanks!