Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2006
    Location
    In a black hole
    Posts
    91

    Need a little FTP Plugin help

    I'm having some error problems on something that looks easy, but obviously I'm not catching it. I used the FTP Plugin example from the help page and trying to download a text file from the the NWS ftp server. I can get the file real easy using a browser. But for some reason using HTTP or FTP don't seem to work for me. I assume I should be using the FTP plugin to get a file from an ftp?

    The code I am trying should be below,..


    Code:
    -- step 1: connect anonymously to cdrom.com
    FTP.Connect("ftp.tgftp.nws.noaa.gov");
    err = Application.GetLastError();
    if err ~= FTP.OK then
        Dialog.Message("Error", _tblErrorMessages[err]);
    end
    
    -- step 2: change to the directory where the text file is located
    FTP.ChangeDir("/data/forecasts/zone/in");
    err = Application.GetLastError();
    if err ~= FTP.OK then
        Dialog.Message("Error", _tblErrorMessages[err]);
    end
    
    -- step 3a: enable the status dialog's cancel button
    StatusDlg.ShowCancelButton();
    
    -- step 3b: show the status dialog
    StatusDlg.Show();
    
    -- step 3c: download the file as <temp>\Hamlet.txt
    FTP.Download("inz001.txt", "\\AutoPlay\\Docs\\alerts\\inz001.txt");
    err = Application.GetLastError();
    
    -- step 3d: hide the status dialog
    StatusDlg.Hide();
    
    -- step 4: log off
    FTP.Disconnect();
    
    -- ...now check whether FTP.Download generated an error
    if err == FTP.OK then
        Dialog.Message("Success!", " was downloaded successfully!");
    else
        Dialog.Message("Error", _tblErrorMessages[err]);
    end

  2. #2
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Without looking to close at your code (off to bed time for me), check out:
    Code:
    FTP.SetTransferType(FTP.BINARY)
    See if that works for you.
    Intrigued

  3. #3
    Join Date
    Jul 2006
    Location
    In a black hole
    Posts
    91
    Thanks,
    I'm still getting a "No Response From Server".
    What ever that is I'm sure would clear up problem #2 "Request to set data port rejected (Port command failed)". Probably should have posted that.

  4. #4
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Hang in there... we have some overseas folks and some late night coders coming on that will surely help you out. If not, tomorrow I'll work with you on it.

    (come on late night coders!)

    Intrigued

  5. #5
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    Well for starters, the address isn't:

    ftp.tgftp.nws.noaa.gov

    ...it's:

    tgftp.nws.noaa.gov

    Also make sure you set the download path to a valid folder, or you'll get an "Unknown error" message. For example, I had to change this line:

    FTP.Download("inz001.txt", "\\AutoPlay\\Docs\\alerts\\inz001.txt");

    ...to this:

    FTP.Download("inz001.txt", "C:\\temp\\inz001.txt");

    ...for it to work on my system.
    Last edited by Lorne; 10-05-2006 at 08:53 AM.
    --[[ Indigo Rose Software Developer ]]

  6. #6
    Join Date
    Jul 2006
    Location
    In a black hole
    Posts
    91
    Figures, ftp.tgftp.nws.noaa.gov is what NWS suggest using. Should have known better then to give gov directions credability. ;-)

  7. #7
    Join Date
    Jul 2006
    Location
    In a black hole
    Posts
    91
    Thanks for the halp Loren.

    Also found that this
    \\AutoPlay\\Docs\\alerts\\inz001.txt
    should have been
    AutoPlay\\Docs\\alerts\\inz001.txt

    A simple one I would have found once I connected.

    All is good.
    This is a very productive forum and community.

    I know it seems like I have a LOT of mindles problems, but I have 6 projects on the bench each having no less then 2000 lines of coding. I think I just get to deep sometimes and tired and miss the easy stuff. ;-)

Similar Threads

  1. Secure FTP
    By TJ_Tigger in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 08-19-2008, 04:46 PM
  2. FTP Plugin and Progress Bar
    By Roboblue in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 03-27-2006, 03:55 AM
  3. FTP Plugin - FTP.SetControlPort?
    By Tek in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 06-28-2005, 10:58 PM
  4. The FTP Plugin
    By 1stOnRamp in forum Setup Factory 7.0
    Replies: 1
    Last Post: 04-23-2005, 04:24 PM
  5. Spotlight: FTP File Transfer Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-10-2004, 09:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts