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
Old 02-23-2009, 08:05 AM FTP Help
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
I'm trying to use the PHP FTP functions to download a file from my remote server to my local computer. I'm fetching the Test4.txt file on my 'mysite1' remote server and I'm running this code on 'mysite2' remote server.

There are two problems I'm having with the following code:

1. The source file (Test4.txt) is being FTP'd from site1 to site2 but the target file (aaaa.txt) is empty. I don't mind the file being copied over to site2 but I'm wondering why it is empty?

2. From what I have read regarding the FTP PHP functions, the ftp_get function's 2nd argument is called the "local" parameter - I *thought* that would mean local as in my local PC but is that not the case?

PHP Code:
$conn ftp_connect("ftp.mysite1.com");
if (
$conn)
   {
     print 
"connection ok<br>";
     
ftp_login($conn,"user","pw");
     
ftp_get($conn,"aaaa.txt","public_html/Test4.txt",FTP_ASCII);
   }
else
   {
     print 
"connection failed<br>";
   }
ftp_close($conn); 
__________________
RalphF
Business Text Messaging Services

Please login or register to view this content. Registration is FREE
rfresh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2009, 08:37 AM Re: FTP Help
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
I figured out I needed the full path.

Ok, so now the file is being FTP'd from site1 to site2, but how do I FTP it down to my local PC?
__________________
RalphF
Business Text Messaging Services

Please login or register to view this content. Registration is FREE
rfresh is offline
Reply With Quote
View Public Profile
 
Old 02-23-2009, 09:20 AM Re: FTP Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
With an FTP client. Unless you are running a FTP site on your local machine.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-23-2009, 11:08 AM Re: FTP Help
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
I can't do this using PHP's FTP functions?
__________________
RalphF
Business Text Messaging Services

Please login or register to view this content. Registration is FREE
rfresh is offline
Reply With Quote
View Public Profile
 
Old 02-23-2009, 01:33 PM Re: FTP Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep.

Provided you set up a FTP server on your machine.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to FTP Help
 

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.21823 seconds with 12 queries