Jump to content

progress bar for upload script


SolidBase

Recommended Posts

Hello everyone im new here! (pretty obvious, duh)  ;D

 

Anyways i have an upload script

 

but i wanna add a progress bar to show much percent has been uploaded

and progress bar that looks like from speedyshare.com

 

here is the upload script code

 

<?php
if (($_FILES["file"]["type"] == "audio/mp3")
|| ($_FILES["file"]["type"] == "audio/mpeg")
&& ($_FILES["file"]["size"] < 3200000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
  else
    {
    header( 'Location: index.php' ) ;

    if (file_exists("files/" . $_FILES["file"]["name"]))
      {
      echo $_FILES["file"]["name"] . " already exists. ";
      }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "files/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "files/" . $_FILES["file"]["name"];
      }
    }
  }
else
  {
  echo "Invalid file";
  }
?>

 

i would really appreciate the help

 

Link to comment
https://forums.phpfreaks.com/topic/58397-progress-bar-for-upload-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.