...

View Full Version : Can you help me please for upgrade this code



ALMGHARI
06-15-2009, 10:41 PM
Hello,

Can you help me please for upgrade this code
This code for images upload
<form method="post" enctype="multipart/form-data" action="upload.php" target="_top">
<input type='hidden' name='type' value='direct'>
<p align="center">
<INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
<input type="submit" value="UPLOAD" alt="Start Uploading" style="font-family: Tahoma; font-weight: bold"></form>

Please, can you upgrade this code by java, for
If I click on UPLOAD button, This image is show
http://dc02.arabsh.com/i/00153/2ztkzfo2mlas.gif
http://dc02.arabsh.com/i/00153/2ztkzfo2mlas.gif

I wait any help please
Thanks

jmrker
06-16-2009, 12:25 AM
This is a Javascript solution, not a Java solution, as I think you might be requesting.

This displays the image when the 'upload' button is clicked, but you will need
to determine how to hide it again (if desired) using .style.display = 'none'
when the file has completed the upload.
I don't know if your action program can do that or not. :confused:



<html>
<head>
<title>Load File Test</title>
<script type="text/javascript">
// From: http://dc02.arabsh.com/i/00153/2ztkzfo2mlas.gif

function AltSubmit() {
document.getElementById('LoadingImage').style.display = 'block';
return false; // for testing only, alter this in real script for success
}
</script>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="upload.php" target="_top" onsubmit="return AltSubmit()">
<input type='hidden' name='type' value='direct'>
<p align="center">
<INPUT name='userfile[]' TYPE='file' class='file_input' size='50'> <br>
<input type="submit" value="UPLOAD" alt="Start Uploading" style="font-family: Tahoma; font-weight: bold">
<img id="LoadingImage" src="http://dc02.arabsh.com/i/00153/2ztkzfo2mlas.gif" style="display:none">
</form>
</body>
</html>

ALMGHARI
06-16-2009, 12:43 AM
Hi,

Thank you, But now, the images upload not work
you can check, the file in Attachments
(i added upload link in the file, for your check)
can you see please, and fix
Thanks

jmrker
06-16-2009, 04:33 AM
You didn't follow the instructions in the code.

Try changing:


function AltSubmit() {
document.getElementById('LoadingImage').style.display = 'block';
return false; // for testing only, alter this in real script for success
}

to:


function AltSubmit() {
document.getElementById('LoadingImage').style.display = 'block';
return true;
}

I don't have your 'upload.php' program to do any checks after clicking the submit button.

ALMGHARI
06-16-2009, 04:43 AM
You are wonderful
Thank you

Greetings

jmrker
06-16-2009, 04:44 AM
You're most welcome.
Glad I could help.
Good Luck!
:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum