Results 1 to 11 of 11

Thread: Upload File PHP

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Upload File PHP

    Hello i am using the following code:

    announcement.html:
    Code:
    <form enctype="multipart/form-data" action="uploader.php" method="POST"^gt;
    <input type="hidden" name="MAX_FILE_SIZE" value="1000" />
    Upload File: <input name="uploadedfile" type="file" />
    <input type="submit" value="Upload File" />
    </form>
    uploader.php:
    Code:
    $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”;
    } else{
    echo “There was an error uploading the file, please try 
    
    again!”;
    }
    This is not currently on a server, i will upload it later. At the moment i am running this off my computer. When i click upload after i select my file internet explorer prompts me to download the file uploader.php .

    I want the code in that file to take action i don't want to download it. What is wrong?
    Last edited by noahssite; Jan 21st, 2009 at 07:04 PM.

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