i need a script which will grab many files at once from other server to my server there will be a text form where i can type urls line by line and one input form that i can specify, to which folder it will upload the files i hope you get what i mean.. i want a script that will transfer many files to a specific folder i choose each time. i can pay a little amount for that if required. thanks
If you have root access (VPS or Dedicated) you dont need a script,just use vi to create a list downloaded files and use wget to execute the list.
i am making a gallery script that will index photos from folders and show them on website, but i don't want to connect to ssh each time i wanna do it and i don't wanna download pictures to my computer then upload them to ftp cuz of my slow internet connection thanks for the suggestion
This any good? <?php function get_url( $url ) { $contents = ''; ini_set( 'user_agent', 'User-Agent: PHPGet/1.0' ); if( ( $fp = fopen( $url, 'r' ) ) ) { for( ;($data = fread( $fp, 1024 ) ); ) $contents .= $data; fclose( $fp ); } elseif( function_exists( 'curl_init' ) ) { $ch = curl_init( ); curl_setopt( $ch, CURLOPT_URL, $url ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_USERAGENT, 'User-Agent: PHPGet/1.0' ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $contents .= curl_exec( $ch ); curl_close( $ch ); } elseif( ( $url_info = parse_url( $url ) ) ) { if( $url_info['scheme'] == 'https' ) $fp = fsockopen( 'ssl://' . $url_info['host'], 443, $errno, $errstr, 30); else $fp = fsockopen( $url_info['host'], 80, $errno, $errstr, 30); if( !$fp ) return false; $out = 'GET ' . (isset($url_info['path'])? $url_info['path']: '/') . (isset($url_info['query'])? '?' . $url_info['query']: '') . " HTTP/1.0\r\n"; $out .= "Host: {$url_info['host']}\r\n"; $out .= "User-Agent: PHPGet/1.0\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); for( ;!feof( $fp ); ) $contents .= fgets($fp, 128); list($headers, $content) = explode( "\r\n\r\n", $contents, 2 ); return $content; } else return false; return $contents; } if( $_POST['urls'] ) { $ourput_dir = $_POST['folder']; $urls = explode( "\r\n", $_POST['urls'] ); for($i=0; isset( $urls[$i] ); $i++) { $contents = get_url( $urls[$i] ); $name = explode( '/', $urls[$i] ); $fp = fopen( $ourput_dir . $name[count($name)-1], 'w' ); fwrite( $fp, $contents ); fclose( $fp ); } } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> URLS: (line by line) <textarea name="urls"></textarea><br /> Folder to save to: <input type="text" name="folder" value="./folderto/" /><br /> <input type="submit" value="get" /> </form> <?php } ?> PHP: Sky22