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
ftp_get help on windows server
Old 03-13-2009, 10:49 AM ftp_get help on windows server
Skilled Talker

Posts: 64
Name: Ralph Freshour
Trades: 0
I have a small test script in which I am trying to download a file from my windows server. My script is running on a linux server. I can't login:

Warning: ftp_login() [function.ftp-login]: Login authentication failed.

PHP Code:
$php_host_username "username"
$php_host_password "pw"
$conn ftp_connect(ftp.mysite.com); 
ftp_pasv($connTRUE);
if (
$conn
   { 
     echo 
"ftp connect ok<br>"
     if (
ftp_login($conn,$php_host_username,$php_host_password)) //fails here
        

          echo 
"ftp_login ok<br>"
          if (
ftp_get($conn,"dest.txt""wwwroot/source.txt",FTP_ASCII)) 
             { 
               echo 
"ftp_get ok<br>"
             } 
          else 
             { 
               echo 
"ftp_get fail<br>"
             } 
        } 
     else 
        { 
          echo 
"ftp_login failed<br>"
        } 
   } 
else 
   { 
     echo 
"ftp connect 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 03-13-2009, 11:56 AM Re: ftp_get help on windows server
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
You can't call ftp_pasv until you've logged in successfully. Also, the default port for ftp_connect is 21, verify that you don't need to use an alternate.
__________________

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
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to ftp_get help on windows server
 

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