Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can you help me please for upgrade this code

    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

    I wait any help please
    Thanks

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,091
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb Consider this ...

    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.

    Code:
    <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>

  • #3
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Attached Files Attached Files

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,091
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Arrow

    You didn't follow the instructions in the code.

    Try changing:
    Code:
    function AltSubmit() {
      document.getElementById('LoadingImage').style.display = 'block';
      return false;		// for testing only, alter this in real script for success
    }
    to:
    Code:
    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.

  • #5
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You are wonderful
    Thank you

    Greetings

  • #6
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,091
    Thanks
    38
    Thanked 498 Times in 492 Posts
    You're most welcome.
    Glad I could help.
    Good Luck!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •