
September 17th, 2007, 15:00 PM
|
| Administrator
Join Date: Jun 2007
Posts: 3,709
BRL$: 42,936.15 Thanks: 0
Thanked 14 Times in 10 Posts
Rep Power: 409 | | Run FTP without upload file I try to write php script for upload or download using ftp. Below the script PHP: --------- $ftp_server = "localhost"; $ftp_user_name = "host"; $ftp_user_pass = "password"; $destination_file = "/ftp_server/sale.jpg"; //ftp server $source_file = "D:/sale.jpg"; //local machine $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); 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); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file"; } ftp_close($conn_id); --------- What I want is when I open the script using browser, it will automatic upload or download file from server to my computer. And I put the script into another server that different with my computer. But I can't do that because the script will read the path for computer that use as a php server not local machine that I use Is it possible to create automatic script just with run the script without click browse button to upload or save as to download? If yes how can I do that? Thanks To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts. | |
__________________ █ High Quality To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ Powerful To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.
█ To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts. █ Jobs In !!! - Post Jobs, Hire Employees, Create Blogs and
Earn Money. | | | |