#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    10
    Rep Power
    0

    Connecting to ftp server and getting a list


    Hello group.
    I'm trying to connect to a ftp server and I'm not able to connect. I'm getting the Could not connect to nhc.noaa.gov.
    Here's the code I'm using. Appreciate any suggestions. I've also tried using the IP address with the same result.

    PHP Code:
    $ftp_path="nhc.noaa.gov";
    $conn ftp_connect($ftp_path) or die("Could not connect to $ftp_path");
    $ftp_user_name"anonymous";
    $ftp_user_pass"someone@gmail.com";
    $login_result ftp_login($conn$ftp_user_name$ftp_user_pass);
    ftp_chdir($conn"/atcf/aid_public/");

    print_r (ftp_rawlist($conn,"."));

    ftp_close($conn); 
    Using google chrome, I can go to the url without a problem and get the file list.
    Thanks for any suggestions.
    Bryan
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    Using google chrome, I can go to the url without a problem and get the file list.
    You sure about that? I can't hit that FTP site with PHP, chrome, or an FTP client.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by ManiacDan
    You sure about that? I can't hit that FTP site with PHP, chrome, or an FTP client.
    Yes, here's the link to the site for use in a browser. I'm not allowed to post links so I mangled it a little to show.

    ftp :// ftp. nhc. noaa. gov/ atcf/ aid_public/

    Regards,
    Bryan
  6. #4
  7. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,549
    Rep Power
    2337
    From your original post:

    php Code:
    $ftp_path="nhc.noaa.gov";
    From the link you provided:

    ftp://ftp.nhc.noaa.gov/ atcf/ aid_public/
    Don't you see the difference?
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by ptr2void
    From your original post:



    From the link you provided:



    Don't you see the difference?
    Thanks for the reply. Yes, I've tried every variation of the domain name with ftp in front, not in front etc...
    Right now, I cannot even get to the ftp site again with my browser, but I could 30 minutes ago. Maybe there is a DNS issue. I've even tried to ping the ftp. nhc. noaa. gov site and do not get a response, but I do get a response from nhc. noaa. gov. Same situation with filezilla. It is hit and miss on connecting.

    Would it be too much to ask to copy the code on your machine and run it to see if it works? Sorry if I'm asking too much... I know people's time is important....
    Thanks for any other suggestion you might have.
  10. #6
  11. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6351
    Would it be too much to ask to copy the code on your machine and run it to see if it works?
    That's how I discovered that the server you're trying to hit isn't responding. Note that I even said I couldn't do it in PHP.

    If the site is down, FTP won't work.

    Changing to ftp_connect('ftp.nhc.noaa.gov'); worked for me, again from PHP.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by ManiacDan
    That's how I discovered that the server you're trying to hit isn't responding. Note that I even said I couldn't do it in PHP.

    If the site is down, FTP won't work.

    Changing to ftp_connect('ftp.nhc.noaa.gov'); worked for me, again from PHP.
    Reading your response earlier, I do see you said you tried the script...
    Thanks for your help. Still no luck on my end with the script and the browser is very intermittent ... Seems like IE connects occasionally, but no luck with Chrome.
    Hopefully this is a weekend maintenance thing with the server and not an ongoing problem.
    Thanks again,
    Bryan

IMN logo majestic logo threadwatch logo seochat tools logo