tnen Posted February 1, 2008 Share Posted February 1, 2008 hi i want to upload file using ftp, i found some working code like this <?php function uploadFile($filename,$filename) { $conn_id = ftp_connect("host"); ftp_login($conn_id, "user", "pass"); ftp_put($conn_id, "$file_name", "$filename", FTP_BINARY); ftp_quit($conn_id); return $file_name; } $file_name = $_POST['file_name']; $file_desc = str_replace(chr(13),"<br>", $_POST['file_desc']); $filename = $_FILES['FILENAME']['tmp_name']; $filename_name = $_FILES['FILENAME']['name']; $filename_type = $_FILES['FILENAME']['type']; $filename_size = $_FILES['FILENAME']['size']; $file_source = uploadFile($filename,$filename_name); ?> but the problem that i want to read the server response as ftp clients show COMMAND:> [01/02/2008 04:48:33 م] CWD /cadpic.gif [01/02/2008 04:48:33 م] 550 /cadpic.gif: No such file or directory STATUS:> [01/02/2008 04:48:33 م] Requested action not taken (e.g., file or directory not found, no access). COMMAND:> [01/02/2008 04:48:33 م] CWD / [01/02/2008 04:48:34 م] 250 CWD command successful STATUS:> [01/02/2008 04:48:34 م] PWD skipped. Current folder: "/". COMMAND:> [01/02/2008 04:48:34 م] PASV [01/02/2008 04:48:34 م] 227 Entering Passive Mode (00,000,00,00,223,133). COMMAND:> [01/02/2008 04:48:34 م] STOR cadpic.gif STATUS:> [01/02/2008 04:48:34 م] Connecting FTP data socket... 00.000.00.00:57221... [01/02/2008 04:48:38 م] 150 Opening BINARY mode data connection for cadpic.gif [01/02/2008 04:48:44 م] 226 Transfer complete. ftp_raw returns this response but i couldn't use it to upload files ?? how can i do it or is there any better way to upload ang get the response? Quote Link to comment Share on other sites More sharing options...
tnen Posted February 1, 2008 Author Share Posted February 1, 2008 please help me Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.