Activity Stream
48,167 MEMBERS
61048 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1.     
    #1
    Member

    Wink Image Remote Upload Script

    I'm having trouble making a script that will grab multiple images from urls then save it to the current directory where the script is located I don't need any design, just a script that will be able to do this. Here's what i'm expecting it to look like



    Anyone knows how?

    Hillside Reviewed by Hillside on . Image Remote Upload Script I'm having trouble making a script that will grab multiple images from urls then save it to the current directory where the script is located :( I don't need any design, just a script that will be able to do this. Here's what i'm expecting it to look like <3 http://lulzimg.com/i14/289633.jpg Anyone knows how? Rating: 5

  2.   Sponsored Links

  3.     
    #2
    It begins...
    So you're going to input a set of image urls into the first text box, and when run the image will grab those images and save them to a specified directory, yes? What does the output box do? Echo the links of those images relative to the url specified in the script?

    Also, is this going to be a private script? If yes, you can be a little relaxed in terms of security.

    Post your current code here.

  4.     
    #3
    Retired NinJa
    Website's:
    loledhard.com
    ever heard about curl, Just chk Google for tuts. Curl can leech the image for u on ur server



    You don't hate Justin bieber.You hate the fact you ain't Justin Bieber!

  5.     
    #4
    It begins...
    dump curl, go for an easier solution if it's going to be private - file_get_contents and file_put_contents

  6.     
    #5
    You can call me G
    okay telling it real quick!

    get the urls from the textarea via POST. Explode them in an array.

    then implement this logic..

    Code: 
    foreach($arr as $url){
        $img = file_get_contents($url);
        file_put_contents("/path/to/file", $img);
    }
    not tested but should do the job..



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  7.     
    #6
    Member
    Oh no, what am i going to do with those php codes? my nose is bleeding.. I do not know what i'll do LoL

  8.     
    #7
    It begins...
    This, is technically supposed to work:

    PHP Code: 
    <?php

    $imgPath 
    "/home/admin/domains/xyz.com/folder/"//path where images are to be located
    $baseurl "http://xyz.com/folder/images/"//the base path for images as a url (refer below)
    //so if your images are supposed to be at http://domain.com/img/xyz.jpg then your baseurl is 'http://domain.com/img/' (with trailing slash)
    //essentially, both the above paths should have something in similar with regards to folder structure

    echo '<form enctype="multipart/form-data" action="" method="POST">';
    echo 
    '<textarea rows="10" cols="50" name="urls"></textarea>';
    echo 
    '<input type="submit" name="submit" value="submit" />';
    echo 
    '</form>';

    if (isset(
    $_REQUEST['submit']))
    {
        
    $urls explode("\n"$_POST['urls']);
        
    $imgarray = array();
        foreach (
    $urls as $url)
        {
            
    $url trim($url);
            
    $imgname basename($url);
            
    $localimg $imgPath $imgname;
            
    $img file_get_contents($url);
            
    file_put_contents($localimg$img);
            
    $url $baseurl $imgname;
            
    $echo "$img <br />";
        }
    }

    ?>
    Remember to change the paths on the top

  9.     
    #8
    Member
    Thank You! Works Great! Just Awesome..

    edit: everything was going fine, but when i go to check the file, it says 404 not found because the new file now ends from sdfsd.jpg(original file) to sdfsd.jpg&#37;20%0d. What's wrong?

  10.     
    #9
    It begins...
    Just remember I'm not sanitizing filenames or checking for extensions or anything of that sort in the script, since you said it'd be for private use. So you're best off randomly naming it to prevent someone being able to type it in. It's not very secure, but it'll get the job done.

  11.     
    #10
    Banned
    Hill if you make the script please PM me a copy

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Suggest a image host with remote zip upload
    By Al3xs in forum Hosting Discussion
    Replies: 2
    Last Post: 2nd Aug 2012, 03:31 AM
  2. Remote Upload Script 2011 (need help)
    By apps.trader in forum Webmaster Resources
    Replies: 31
    Last Post: 16th May 2011, 02:54 PM
  3. Replies: 2
    Last Post: 6th Apr 2011, 07:30 PM
  4. Megaupload Remote upload script?
    By illetyus2 in forum Technical Help Desk Support
    Replies: 0
    Last Post: 12th Dec 2010, 12:48 PM
  5. RS to RS remote upload script
    By Bose in forum Webmaster Resources
    Replies: 9
    Last Post: 14th May 2010, 03:23 AM

Tags for this Thread

BE SOCIAL