Help with upload from url

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with upload from url

    Please someone provide me a *single page* php script. Which works like this:
    1)I open INDEX.PHP file in browser.
    2)there is only an upload button and nothing else. I click the upload button.
    3)The file "example.net/subzero-is.rude" gets uploaded to the same directory as index.php(in my server).
    3)SHOW where the file was uploaded 4)Nothing else
    So its like copying file from another server to my server.

    THERE SHOULD NOT BE ANYTHING BUT AN SUBMIT BUTTON IN THE PAGE.NO PLACE FOR A URL. I will define the url inside THE PAGE.
    Last edited by Sifat3d; 22.09.11, 05:37.

    #2
    Other words you want to download php of other site ?

    that can not be done you will look like a fool for trying.
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      PHP Code:

      <?php

      $url 
      'http://urltograb.com/file.ext';

      if(isset(
      $_POST['submit'])){

      if(
      $con=@file_get_contents($url))
      {
          
      $details pathinfio($url);
          
      $name $details['basename'];
          
      $ext = isset($details['extension']) ? $details['extension'] : 'dat'
          
      $fullname $name.'.'.$ext;

          if(
      file_put_contents($fullname$con))
          {
             echo 
      "file has been saved successfully";
           }
      }
      else
      {
       echo 
      "cannot download this file";
      }


      }
      ?>

      Code:
      <form action="" method="post">
      <input type="submit" name="submit" value="getfile"/>
      </form>
      Last edited by antony2kx; 21.09.11, 18:12.

      Comment


        #4
        @sub,It was just an EXAMPLE, it could be anything. :-(

        @Thanks antony
        Last edited by Sifat3d; 22.09.11, 05:38.

        Comment

        Working...
        X