url uploader

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

    url uploader

    is it possible to make url uploader in autoindex script ?? let me know how ? they say sea script support url uploading . but how?? there is no option for url uploading ..

    #2
    settings.php
    PHP Code:
    <?php
    defined
    ('_ALLOWINCLUDE') or die();

    // Default destination to copy files too NO TRAILING SLASH!!
    // If it is complete path, file be copied there ex: /home/public_html/FOLDER (Linux), C:\htdocs\FOLDER (Windows)
    // If it is just a direcotory it will be copied to that directory in directory the script is in ex: /SnatcherFolder/FOLDER
    $defaultDest 'snatched';
        
    /*
        More examples
        If $defaultDest = ''; it will automatically copy to the `snatched` directory inside of the script's directory.
        If $defaultDest = 'files'; it will copy to `files` directory inside of the script's directory.
        */

    // If you want a password to be required
    // Remember if you don't have a password anyone can copy a file to your server!
    $password ''

    // URL to location of snatched files WITH OUT TRAILING SLASH
    $URLDest 'http://somesite.con/snatched';


    // Put a limit for file size in kilobytes (1024KB is 1MB)
    // For unlimited put 0
    // Example $sizelimit = 25;
    $sizelimit 0;

    ?>
    index.php
    PHP Code:
    <?php
    //File Snatcher 2.7
    define('_ALLOWINCLUDE',0);
    include 
    'settings.php';
    $version '2.7';
    //////////////////////////////////////////////
    //Do Not Change Below Here////////////////////
    //////////////////////////////////////////////
    if (function_exists('curl_init'))
    {
        
    $snatch_system 'curl';
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="style.css">
    <title>File Snatcher <?php echo $version?> - &copy; http://somesite.con</title>
    </head>
    <body>

    <div id="main">
    <?php
    $submit 
    $_POST['submit'];
    if (
    $submit)
    {
        if (isset(
    $password))
        {
            if (
    $_POST['password'] != $password)
            {
                die(
    '<p><strong>Password incorrect!</strong></p>');
                
    $error true;
            }
        }
        
        if (!
    $defaultDest)
        {
            
    $defaultDest 'snatched';
        }
        
        if (!
    file_exists($defaultDest))
        {
            
    mkdir($defaultDest);
        }
        
        
    $sizelimit $sizelimit 1024;
        
        
    $file $_POST['file'];
        
        
    $uploadfile explode('/'$file);
        
    $filename array_pop($uploadfile);
        
        
    $newfilename $_POST['new'];
        
        if (!
    $newfilename)
        {
            
    $newfilename $filename;
        }
        
        if (!isset(
    $file))
        {
            echo 
    '<p><strong>Please enter a URL to retrieve file from!</strong></p>';
            
    $error true;
        }
        
        if (!isset(
    $newfilename))
        {
            echo 
    '<p><strong>Please enter a new file name!</strong></p>';
            
    $error true;
        }
        
        if (
    $error == false)
        {
            
    $dest $defaultDest;
            
    $ds = array($dest'/'$newfilename);
            
    $ds implode(''$ds);
            
    $newname_count 0;
            if (
    file_exists($ds))
            {
                echo 
    '<p><strong>File already exists!</strong></p>';
                
    $newname_count++;
                
    $newfile = array($newname_count$newfilename);
                
    $newfile implode('~'$newfile);
                
    $newfile_ds = array($dest'/'$newfile);
                
    $newfile_ds implode(''$newfile_ds);
                while(
    $renamed == false)
                {
                    if (
    file_exists($newfile_ds))
                    {
                        
    $newname_count++;
                        
    $newfile = array($newname_count$newfilename);
                        
    $newfile implode('~'$newfile);
                        
    $newfile_ds = array($dest'/'$newfile);
                        
    $newfile_ds implode(''$newfile_ds);
                    }
                    else
                    {
                        
    $renamed true;
                    }
                }
                
    $newfilename $newfile;
                
    $ds $newfile_ds;
                echo 
    '<p>New file name is <strong>'.$newfile.'</strong>.</p>';
            }
            echo 
    '<p><strong>Copying...</strong></p>';
            if (
    $snatch_system == 'curl')
            {
                
    $ch curl_init($file);
                
    $fp fopen($ds'w');
                
    curl_setopt($chCURLOPT_FILE$fp);
                
    curl_setopt($chCURLOPT_HEADER0);
                
    curl_exec($ch);
                
    $curl_info =  curl_getinfo($ch);
                
    curl_close($ch);
                
    fclose($fp);
            }
            else
            {
                if (!
    copy($file$ds))
                {
                    echo 
    '<p>Was unable to copy <a href="'.$file.'">'.$file.'</a><br />See if your path and destination are correct.</p>';
                    
    $copy_fail true;
                }
            }
            
            if (
    $copy_fail == false)
            {
                if (
    $sizelimit && filesize($ds) > $sizelimit)
                {
                    echo 
    '<p><strong>File is too large.</strong>';
                    
    unlink($ds);
                }
                else
                {
                    echo 
    '<p><strong>Copy successful!</strong></p>';
                    echo 
    '<p><a href="'.$URLDest.'/'.$newfilename.'">Click here for file</a></p>';
                    if (
    $snatch_system == 'curl')
                    {
                        
    $size_dl round($curl_info['size_download']/10242);
                        
    $speed_dl round($curl_info['speed_download']/10242);
                        echo 
    '<p>Downloaded '.$size_dl.'KB in '.$curl_info['total_time'].' seconds.<br />With an average download speed of '.$speed_dl.'KB/s.';
                    }
                }
            }
        }
    }

    $self $_SERVER['PHP_SELF'];
    echo 
    '<form method="POST" action="'.$self.'">';
    echo 
    '<fieldset><legend>File Snatcher</legend>';
    echo 
    '<label for="file">Full path to file to copy</label>';
    echo 
    '<p>Example: http://foobar.com/image.png</p>';
    echo 
    '<input type="text" name="file" id="file" size="45" value="">';
    echo 
    '<label for="new">New file name (Optional)</label><br />';
    echo 
    '<p>Example: image.png</p>';
    echo 
    '<input type="text" name="new" id="new" size="45" value="">';
    if (isset(
    $password))
    {
        echo 
    '<label for="password">Password</label>';
        echo 
    '<input type="password" name="password" id="password" size="45" value=""><br />';
    }
    echo 
    '<p><input name="submit" type="submit" id="submit" value="submit" accesskey="s"></p>';
    echo 
    '</fieldset></form>';
    ?>
    </div>
    </body>
    </html>

    Comment


      #3
      its uploading all file in 1.31kb size .....not copying properly

      Comment


        #4
        Originally posted by wap4ads View Post
        its uploading all file in 1.31kb size .....not copying properly
        heres your answer i guess:
        Originally posted by kiLLeR-eyEd_14 View Post
        Try diz in ur .htaccess
        PHP Code:
        php_value upload_max_filesize 100M
        php_value post_max_size 100M
        php_value max_execution_time 1000
        php_value max_input_time 1000 

        Comment


          #5
          thanks for your valueable reply could you please tell me how to use this script in autoindex

          Comment


            #6
            That script copys other peoples files and puts them on to your site .... i think you are wanting to keep the files on there server ?
            in which case you would be wanting to make a grabber script ......
            grabber script will be so different on every page you grab there is no easy way of doing it ... here is a tutorial:

            Comment

            Working...
            X