Results 1 to 4 of 4

Thread: need help with small php upload file script

Threaded View

  1. #1

    Thread Starter
    Addicted Member MoE70's Avatar
    Join Date
    May 2006
    Posts
    185

    need help with small php upload file script

    if you have apache please try to get this script to upload mp3 files. it keeps saying invalid file what ever i do.

    PHP Code:
    <?php
    if (($_FILES["file"]["type"] == "audio/x-ms-wma")
    || (
    $_FILES["file"]["type"] == "audio/mp3")
    && (
    $_FILES["file"]["size"] < 20000000000))
      {
      if (
    $_FILES["file"]["error"] > 0)
        {
        echo 
    "Return Code: " $_FILES["file"]["error"] . "<br />";
        }
      else
        {
        

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

Posting Permissions

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



Click Here to Expand Forum to Full Width