FTP?
<html><head><title>Schumi - Upload Form</title><script type=\"text/javascript\">function UpMutat(id) {var e = document.getElementById(id);if(e.style.visibility == \'visible\') e.style.visibility = \'hidden\';else e.style.visibility = \'visible\';}</script><style type=\"text/css\"><!--html, body {background-color: #000000;height: 100%;padding: 0;margin: 0;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 14px;color: #FFFFCC;} .upstyle {position:absolute;width:99%;height: 98%;z-index:1;left: 0px;top: 0px;background-color: #000000;border-style: solid;border-width: 3px;border-color: FFFFCC;overflow: visible;visibility: hidden;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 21px;color: #FFFFCC;}--></style></head><body><div align=\"center\" class=\"upstyle\" id=\"uploading\"><p align=\"center\"><br><br><b>Uploading file(s)!<br><br>Please wait!</p></div><center><p>Upload files here, 5 files at a time. (512 MB/file, 1024 MB MAX)</p><p><form name=\"fileup\" method=\"post\" enctype=\"multipart/form-data\" action=\"upload.php\"><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><br><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"5120000000\"><input type=\"submit\" id=\"sub\" value=\"submit\" name=\"submit\" onclick=\"UpMutat(\'uploading\');\"></form></center></body></html>
<html><body bgcolor=\"000000\"><center><font face=\"verdana\" size=\"3\" color=\"FFFFCC\"><?//uses $_FILES[] global array//see manual for older PHP version info//This function will be used to get the extension from the filenameFunction get_extension($file,$length=-1){$p = strrpos($file,\".\");$p++;If($length!=-1){$ext = substr($file,$p,$length);}If($length==-1){$ext = substr($file,$p);}$ext = strtolower($ext);Return $ext;}//Not good practice, but here anyway//change to suit your needs//also some have to be set in the ini//for this to correctly work//512 MB max. méretIni_set(\"upload_max_filesize\",\"512M\");//turn on file uploadsIni_set(\"file_uploads\",\"1\");//set your temp dirIni_set(\"upload_tmp_dir\",\"/temp\");//set post size large enough to accomidate//3 100meg files and some overheadIni_set(\"post_max_size\",\"1024M\");?></p><?//check to see if we have submited yetIf($_POST[\"submit\"]!=\"submit\"){//not yet so lets make the form?><?}//see if we have submited and that the files array has been setIf(($_POST[\"submit\"]==\"submit\")&&(is_array($_FILES[\'userfiles\']))){$ftp_user_name=\"[email protected]\"; //change to ftp username$ftp_user_pass=\"valami_jelszo\"; //change to ftp password$ftp_server=\"ftp.valami.hu\"; //change to ftp url$ftp_dump_dir=\"/uploaded_files\"; //change to destination directory//go through all the filesFor($x=0;$x<count($_FILES[\'userfiles\'][\'name\']);$x++){//now we do some file checking//check to see if file is thereIf($_FILES[\'userfiles\'][\'name\'][$x]!=\"none\"){//file has a name//check filesizeIf($_FILES[\'userfiles\'][\'size\'][$x]!=0){//file is larger than 0 bytes//Check to see if it is uploadedIf(is_uploaded_file($_FILES[\'userfiles\'][\'tmp_name\'][$x])){//file has been uploaded!//let the user know their file has be uploadedEcho \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" uploaded successfully!<br><br>\";//conect to ftp server$conn_id = ftp_connect($ftp_server);// login with username and password$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);// check connectionIf ((!$conn_id) || (!$login_result)) {Echo \"FTP connection has failed!<br><br>\";Echo \"Attempted to connect to $ftp_server for user $ftp_user_name\";Exit;} else {Echo \"Connected to $ftp_server! <br><br>\";//set PASV modeIf(!ftp_pasv($conn_id,TRUE)){Echo \"Could not enter PASV mode!\";}//rename to file#_date.Ext$filename = $_FILES[\'userfiles\'][\'name\'][$x];//$filename.= \".\".Get_extension($_FILES[\'userfiles\'][\'name\'][$x],3);//change directory//If (@ftp_chdir($conn_id, $ftp_dump_dir)) {//maybe you want to make sure we are in the correct directory//Echo \"Current directory is now : \", ftp_pwd($conn_id), \"\\and\";//} else {//you want to know if it didn\'t work//Echo \"Couldn\'t change directory\\and\";//}//upload the file and let the user know what happenedIf(ftp_put($conn_id,$filename,$_FILES[\'userfiles\'][\'tmp_name\'][$x],FTP_BINARY)){Echo \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" was sent successfully<br><br>\";Echo \"File was named: \".$filename.\"<br>\";}else{Echo \"There was a problem sending file \".$_FILES[\'userfiles\'][\'name\'][$x].\"<br><br>\";;}}// close the FTP streamFtp_close($conn_id);}Else echo\"File was not uploaded!<br><br>\";}}Echo \"<br>\";}//end for loop}//That\'s all folks!?><a href=\"index.php\" target=\"_self\">Back to Upload form!</a></font></center><body></html>
Ilyen találtam:Majd írd át az adatokat! index.php fájl: <html><head><title>Schumi - Upload Form</title><script type=\"text/javascript\">function UpMutat(id) {var e = document.getElementById(id);if(e.style.visibility == \'visible\') e.style.visibility = \'hidden\';else e.style.visibility = \'visible\';}</script><style type=\"text/css\"><!--html, body {background-color: #000000;height: 100%;padding: 0;margin: 0;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 14px;color: #FFFFCC;} .upstyle {position:absolute;width:99%;height: 98%;z-index:1;left: 0px;top: 0px;background-color: #000000;border-style: solid;border-width: 3px;border-color: FFFFCC;overflow: visible;visibility: hidden;font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 21px;color: #FFFFCC;}--></style></head><body><div align=\"center\" class=\"upstyle\" id=\"uploading\"><p align=\"center\"><br><br><b>Uploading file(s)!<br><br>Please wait!</p></div><center><p>Upload files here, 5 files at a time. (512 MB/file, 1024 MB MAX)</p><p><form name=\"fileup\" method=\"post\" enctype=\"multipart/form-data\" action=\"upload.php\"><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><input type=\"file\" name=\"userfiles[]\" size=\"70\"><br><br><br><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"5120000000\"><input type=\"submit\" id=\"sub\" value=\"submit\" name=\"submit\" onclick=\"UpMutat(\'uploading\');\"></form></center></body></html> upload.php fájl: <html><body bgcolor=\"000000\"><center><font face=\"verdana\" size=\"3\" color=\"FFFFCC\"><?//uses $_FILES[] global array//see manual for older PHP version info//This function will be used to get the extension from the filenameFunction get_extension($file,$length=-1){$p = strrpos($file,\".\");$p++;If($length!=-1){$ext = substr($file,$p,$length);}If($length==-1){$ext = substr($file,$p);}$ext = strtolower($ext);Return $ext;}//Not good practice, but here anyway//change to suit your needs//also some have to be set in the ini//for this to correctly work//512 MB max. méretIni_set(\"upload_max_filesize\",\"512M\");//turn on file uploadsIni_set(\"file_uploads\",\"1\");//set your temp dirIni_set(\"upload_tmp_dir\",\"/temp\");//set post size large enough to accomidate//3 100meg files and some overheadIni_set(\"post_max_size\",\"1024M\");?></p><?//check to see if we have submited yetIf($_POST[\"submit\"]!=\"submit\"){//not yet so lets make the form?><?}//see if we have submited and that the files array has been setIf(($_POST[\"submit\"]==\"submit\")&&(is_array($_FILES[\'userfiles\']))){$ftp_user_name=\"[email protected]\"; //change to ftp username$ftp_user_pass=\"valami_jelszo\"; //change to ftp password$ftp_server=\"ftp.valami.hu\"; //change to ftp url$ftp_dump_dir=\"/uploaded_files\"; //change to destination directory//go through all the filesFor($x=0;$x<count($_FILES[\'userfiles\'][\'name\']);$x++){//now we do some file checking//check to see if file is thereIf($_FILES[\'userfiles\'][\'name\'][$x]!=\"none\"){//file has a name//check filesizeIf($_FILES[\'userfiles\'][\'size\'][$x]!=0){//file is larger than 0 bytes//Check to see if it is uploadedIf(is_uploaded_file($_FILES[\'userfiles\'][\'tmp_name\'][$x])){//file has been uploaded!//let the user know their file has be uploadedEcho \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" uploaded successfully!<br><br>\";//conect to ftp server$conn_id = ftp_connect($ftp_server);// login with username and password$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);// check connectionIf ((!$conn_id) || (!$login_result)) {Echo \"FTP connection has failed!<br><br>\";Echo \"Attempted to connect to $ftp_server for user $ftp_user_name\";Exit;} else {Echo \"Connected to $ftp_server! <br><br>\";//set PASV modeIf(!ftp_pasv($conn_id,TRUE)){Echo \"Could not enter PASV mode!\";}//rename to file#_date.Ext$filename = $_FILES[\'userfiles\'][\'name\'][$x];//$filename.= \".\".Get_extension($_FILES[\'userfiles\'][\'name\'][$x],3);//change directory//If (@ftp_chdir($conn_id, $ftp_dump_dir)) {//maybe you want to make sure we are in the correct directory//Echo \"Current directory is now : \", ftp_pwd($conn_id), \"\\and\";//} else {//you want to know if it didn\'t work//Echo \"Couldn\'t change directory\\and\";//}//upload the file and let the user know what happenedIf(ftp_put($conn_id,$filename,$_FILES[\'userfiles\'][\'tmp_name\'][$x],FTP_BINARY)){Echo \"File \".$_FILES[\'userfiles\'][\'name\'][$x].\" was sent successfully<br><br>\";Echo \"File was named: \".$filename.\"<br>\";}else{Echo \"There was a problem sending file \".$_FILES[\'userfiles\'][\'name\'][$x].\"<br><br>\";;}}// close the FTP streamFtp_close($conn_id);}Else echo\"File was not uploaded!<br><br>\";}}Echo \"<br>\";}//end for loop}//That\'s all folks!?><a href=\"index.php\" target=\"_self\">Back to Upload form!</a></font></center><body></html>
Akkor próbáld kisebb fájlal.