Jump to content


Photo

Upload Progress Bar??? HELP!!!


  • Please log in to reply
3 replies to this topic

#1 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 05 September 2006 - 03:15 AM

hey so i have a working PHP code for a upload form, but i wana make a progress bar for it. so like if it's a pretty big file, people will know how much longer it'l take. here is my current code:

<?php
$bad_types = array('application/octet-stream','application/x-msdos-program','application/x');
if( in_array( $_FILES['uploadedfile']['type'], $bad_types ) )
{
    echo "That File type is not supported.";
}
else
{
$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "The file ".  basename( $_FILES['uploadedfile']['name']).
        " has been uploaded. here is the link to your file: <a href=uploads/".  basename( $_FILES['uploadedfile']['name']). ">".  basename( $_FILES['uploadedfile']['name'])."</a>";
    } else{
        echo "There was an error uploading the file, please try again!";
    }
}
?>


#2 Gregg

Gregg
  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts
  • LocationUSA

Posted 05 September 2006 - 04:17 AM

PREVIEW YOUR UPLOAD SCRIPT HERE
I all ready made it,yeah i included a "Ban" function for you.
It allows only the files you want and places in folder securly!

If you want an "Image Loading Bar" just ad it tothe config file.

Mail me for the files here: Mail Me Here

#3 Humpty

Humpty
  • Members
  • PipPipPip
  • Advanced Member
  • 132 posts

Posted 05 September 2006 - 05:07 AM

I wouldn't mind seeing / having that code.  I thought an upload progress bar wasn't possible with PHP.
- Humpty
  #> Where does the light go when it goes out?

#4 Gregg

Gregg
  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts
  • LocationUSA

Posted 05 September 2006 - 05:46 AM

It wouldent be just in php,
Just the call function in the php "On Submit" then it would load the "Progress Bar" then close on file completion!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users