markcunningham07 Posted July 19, 2010 Share Posted July 19, 2010 Hi, I have 2 servers. one server runs website, other host files. assume website server : server A File hosting server : server B I have a script that have 2 files index.html user select a file Content of Index.html : <form enctype="multipart/form-data" action="upload.php" method="post"><br> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /><br> Send this file: <input name="userfile" type="file" /><br> <input type="submit" value="Send File" /><br> </form> upload.php upload the file to server B upload.php file content <?php // variables $ftp_server = "Server B IP"; $ftp_user_name = "Username"; $ftp_user_pass = "password"; $destination_file = "images/".$_FILES['image']['name']; $sourcefile = $_FILES['image']['name']; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // line 30 // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } // close the FTP stream ftp_close($conn_id); ?> I get following error when uploading a file. Connected to 173.193.6.194, for user streamer FTP upload has failed! It successfully connect to ftp server, but can not upload the file. Please help me to figure this out. More info : Server A : Hosting server run linux and have parallel Plesk Server B : windows server 2003 enterprises R2, has IIS, and in IIS i made FTP. i can connect and upload file to FTP folder using filezilla. if you need more info to troubleshoot this issue please ask me. Link to comment https://forums.phpfreaks.com/topic/208139-upload-fail-error-from-script/ Share on other sites More sharing options...
markcunningham07 Posted July 19, 2010 Author Share Posted July 19, 2010 i am trying to make a folder on server B to CMOD 777 using filezilla, i get following error msg : Command: SITE CHMOD 777 images Response: 500 'SITE CHMOD 777 images': command not understood Status: Disconnected from server How do i make image folder CHMOD to 777 Link to comment https://forums.phpfreaks.com/topic/208139-upload-fail-error-from-script/#findComment-1088004 Share on other sites More sharing options...
markcunningham07 Posted July 19, 2010 Author Share Posted July 19, 2010 Found a new script, dont worry about answering this post. i no longer need this script. Link to comment https://forums.phpfreaks.com/topic/208139-upload-fail-error-from-script/#findComment-1088006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.