Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Image upload add.cgi

Quote Reply
Image upload add.cgi
Is there a way to put in a progress bar or disable submit button to keep user from double clicking or leaving page before uploads are complete. I tried Andy's ajax uploader, which is nice, but not workable in a situation where user might upload images in any order
Quote Reply
Re: [kitsmedia] Image upload add.cgi In reply to
Hi,

You could try changing the button, so its something like:

Code:
<form method="POST" action="<%config.db_cgi_url%>/add.cgi" onsubmit="document.getElementById('submit_button').disabled = true">

..then for the buttons in modify.html/add.html, add in:

Code:
id="submit_button"

..to the submit button.

I've tested this locally, and it looks like it works fine Smile

Cheers

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: [Andy] Image upload add.cgi In reply to
Hi Andy. I tried exactly that and several similar. It certainly disables the submit button but the page doesn't continue on to the add_success page. After what appears to be an appropriate upload time it reloads the form with no sign of the upload anywhereFrown
Quote Reply
Re: [kitsmedia] Image upload add.cgi In reply to
Hi,

Do you have the enctype="" multipart bit in the <form ? Without that, it will *try* to send the file - but GLinks won't be able to grab the file

Code:
<form .... enctype="multipart/form-data">

Cheers

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: [Andy] Image upload add.cgi In reply to
Yes..that stuff is all included. Tried several other things. Still no luck. Upload will not continue on to success page where the army of Ultranerd Thumb_Images is waiting to attack the little bastards.
Quote Reply
Re: [kitsmedia] Image upload add.cgi In reply to
Hi,

Send over FTP + GLinks info via email, and I'll take a quick look for ya

Cheers

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: [kitsmedia] Image upload add.cgi In reply to
I use a separate page in an iframe but it might work in the add template.

First off find a loading gif (plenty on google image search) and upload it to your image directory.

On the add.html template (if that's what you're using) add the following (in red):

Code:
<form action="<%config.db_cgi_url%>/add.cgi" enctype="multipart/form-data" method="post">
<%include include_form.html%>
<script language="javascript" type="text/javascript">
function showTable() {
document.getElementById("image").style.display = "block";
}
function hideTable() {
document.getElementById("image").style.display = "none";
}
window.onload = hideTable;
</script>

<div class="formsubmit">
<input type="reset" name="reset" value="Reset" class="submit" />
<input type="submit" name="add" value="Submit" class="submit" onClick="showTable()" />
</div>
<div>
<img src="/image_directory/loading.gif" width="" height="" alt="Loading">
</div>

</form>

I don't know if it will work in your situation but it's worth a try.

Last edited by:

MJB: Nov 10, 2011, 2:39 PM
Quote Reply
Re: [MJB] Image upload add.cgi In reply to
I missed id=image off the div but I can't edit my post. It should be:

Code:
<div id=image>
<img src="/image_directory/loading.gif" width="" height="" alt="Loading">
</div>
Quote Reply
Re: [MJB] Image upload add.cgi In reply to
Sorry, should have replied. I got it working. The JS code was fine - but it was something weird going on with his add.html template (for some reason - add=1 was not being passed along to add.cgi, so it never knew you were trying to add the link - thus why there were no errors, and the link was never added :))

Cheers

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!