Results 1 to 2 of 2

Thread: Trying to upload through link, help.

  1. #1
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Trying to upload through link, help.

    How can I modify this file upload script to get a file from www.example.com/download.zip.

    <?php
    //set where you want to store files
    //in this example we keep file in folder upload
    //$HTTP_POST_FILES['ufile']['name']; = upload file name
    //for example upload file name cartoon.gif . $path will be upload/cartoon.gif
    $path= "upload/".$HTTP_POST_FILES['ufile']['name'];
    if($ufile !=none)
    {
    if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
    {
    echo "Successful<BR/>";

    }
    ?>

  2. #2
    Join Date
    Sep 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    this looks like old code - $HTTP_POST_FILES hasn't been used for a long time.

    also, if you're looking to pull a file from a URL, look into fopen() or cURL. The code you posted is for taking a file posted by a user and uploading it to your server. I'm not clear by your post which you're trying to do.

    If you're trying to do file uploads, handling file uploads should have everything you need.

Bookmarks

Posting Permissions

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