Gossamer Forum
Home : Products : Others : Fileman :

Message while uploading

Quote Reply
Message while uploading
I want to show a message on the screen ("Please wait, uploading in process...") as long as file upload is in process. How can I do this?

Edgar

Quote Reply
Re: Message while uploading In reply to
Hello...

I'm new to this whole CGI thing, so bare with me. Smile

This is somewhat of a crude example of how this could be done... I'm not the least bit any kind of expert at this.

In your fileman.cgi file find the javascript area under your sub main area:

(i.e...
# Javascript form validation.
my $javascript = qq~
<script language="Javascript">
.
.
.
function serverFileName() {
var fileName = window.document.Upload.data.value.toLowerCase();
window.document.Upload.fn.value = fileName.substring(fileName.lastIndexOf("\\\\") + 1,fileName.length);
}

// -->
</script>


and then add this to the end of the javascript area just before the // --></script>


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=460,height=60,left = 90,top = 210');");
}



Now... find this section under the sub list_files:


onFocus="select()" onBlur="validateFileEntry(this.value, this)">
<input type="submit" value="Upload"></font>


Make it look something like this:


onFocus="select()" onBlur="validateFileEntry(this.value, this)">
<input type="submit" value="Upload" onClick="javascript:popUp('uploading.html')"></font>


Now create a HTML file similar to this:


<HTML>
<HEAD>
<TITLE>Uploading...</TITLE>
</HEAD>
<BODY>
<P><center>Uploading in Progress...</center></p>
</BODY>
</HTML>


and place the HTML file in the same directory as fileman.cgi.

Of course you can tweek the javascripting and the HTML to your tastes. Hope that this was some sort of help. Well... at least a start in the right direction! Tongue

Jeremy Kerr
http://www.indianawebsites.com

Quote Reply
Re: Message while uploading In reply to
Hello

Thank you, that's what I was looking for. But:
How do I close the window 'uploading.html' AUTOMATICALLY, when the upload-process has finished?

Edgar

Quote Reply
Re: Message while uploading In reply to
Hello again... and sorry it took so long to respond!

Ok... the best thing that I could come up with is to have the popup window close after a certain amount of time. I couldn't exactly figure out how to close it when the parent window is done loading. But here is another crude way of doing this.

Using the HTML example that I gave you... just change it to look something like this:

<HTML>
<HEAD>
<TITLE>Uploading...</TITLE>
</HEAD>
<BODY onLoad="setTimeout(window.close, 5000)">
<P><center>Uploading in Progress...


This window will close after upload is complete.</center></p>
</BODY>
</HTML>

Now... in the onload code above the 5000 = 5 seconds. Change that to an estimated time that you feel it would take to upload something.

This is the best that I could come up with at the time. Smile

Regards...

Jeremy
http://www.indianawebsites.com