i need script to upload to many free file hosting servers

Discussion in 'PHP' started by Ahmed Abd El-Hamid, Mar 28, 2008.

  1. #1
    i need script to upload to many free file hosting servers

    Like http://www.shareonall.com

    please Help

    thanks
     
    Ahmed Abd El-Hamid, Mar 28, 2008 IP
  2. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's not a big deal. Your can use curl fuction to remotly upload single/multiple file through known ftp.

    I have already done this type of experiment various time.
    for example

    <?php
    //
    // A simple PHP/CURL FTP upload to a remote site
    //

    $ch = curl_init();
    $localfile = "me-and-my-dog.jpg"
    .
    $fp = fopen ($localfile, "r");

    // we upload a JPEG image
    curl_setopt($ch, CURLOPT_URL,
    "ftp://mynamw:mypassword@ftp.mysite.com/path/to/destination.jpg");
    curl_setopt($ch, CURLOPT_UPLOAD, 1);
    curl_setopt($ch, CURLOPT_INFILE, $fp);

    // set size of the image, which isn't _mandatory_ but helps libcurl to do
    // extra error checking on the upload.
    curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));

    $error = curl_exec ($ch);

    // check $error here to see if it did fine or not!

    curl_close ($ch);
    ?>
     
    singh.ajit05, Mar 28, 2008 IP
  3. Ahmed Abd El-Hamid

    Ahmed Abd El-Hamid Guest

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks Put I Need A Ready Script

    Because I Don't Know The Ftp Access

    Thanks

     
    Ahmed Abd El-Hamid, Mar 29, 2008 IP
  4. thecheapsters

    thecheapsters Peon

    Messages:
    183
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am also trying this method but its not working
     
    thecheapsters, Mar 30, 2008 IP
  5. PowerExtreme

    PowerExtreme Banned

    Messages:
    2,118
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ull first need to understand the uploading sysem of the sites and then using curl transfer files from ur server to the uploading servers
     
    PowerExtreme, Mar 30, 2008 IP
  6. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    for uploading a file just use this:

    //sample.html
    <form action="sendmail.php" method="post" name="f1" id="f1" enctype="multipart/form-data">
    Upload image :<input name="fileatt" type="file">
    <form>
    //sendmail.php
    <?php
    $uploadfile="";
    $fileatt=$_FILES['fileatt']['tmp_name'];
    $fileatt_type = $_FILES['fileatt']['type'];
    $fileatt_name = $_FILES['fileatt']['name'];
    // code for check
    $ext = strrchr($_FILES['fileatt']['name'],'.');
    if (($extlimit == "yes") && (!in_array($ext,$limitedext))) {
    echo("Wrong file extension. ");
    exit();
    }

    if($fileatt_name!="")
    {
    $uploadfile=$cpath."resume/".$fileatt_name;
    if (($fileatt_type=="image/pjpeg") || ($fileatt_type=="image/jpeg") || ($fileatt_type=="image/gif"))
    {
    @move_uploaded_file($fileatt , $uploadfile) or die('Resume upload problem.');
    }
    }
    echo $fileatt_name;
    ?>
     
    singh.ajit05, Apr 1, 2008 IP
  7. MOUPAP

    MOUPAP Guest

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Isn't he supposed to have authorized access from all the other uplaod providers??
     
    MOUPAP, Apr 2, 2008 IP