Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Run FTP without upload file
Old 09-17-2007, 05:26 AM Run FTP without upload file
Skilled Talker

Posts: 72
Trades: 0
I try to write php script for upload or download using ftp. Below the script
PHP Code:

$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_fileFTP_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
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
jaketmerah is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Run FTP without upload file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.07999 seconds with 12 queries