Results 1 to 3 of 3

Thread: Building a file uploader in PHP

  1. #1

    Building a file uploader in PHP

    folks,

    Question about file uploading. I have a very simple self processing form, the file upload of which works fine. I have a simple rotating graphic ...your files are uploading please wait... that is set to show when the form is submitted. But, no matter where I put the file upload code on the form on submit the form seems to process all the information before showing the uploader. Any ideas or tutorials out there?

  2. #2
    sorrie no idea

  3. #3
    1,839
    posts
    Registered User
    use javascript to place the image in a div in the submitbutton onclick

    <?php
    if(isset($_FILE['file'])){
    //proccess File
    }

    ?>
    <javascript>
    function loadImage(){
    document.getElementById('loadimg').style.display=" block";
    }
    </javascript>
    <div id='loadimg' style='display:none'>
    <img src='loader.gif'>
    </div>
    <form action='' enc-type='multipart-data'> <-this tag is prolly wrong
    <input type='file' name='file'>
    <input type='submit' onclick='loadImage()'>
    </form>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012