Alpha Video Training
Results 1 to 8 of 8

Thread: Downloading files from FTP site

  1. #1
    Sarah Mengesha
    Guest

    Default Downloading files from FTP site

    I started out thinking that it would be pretty simple to copy files I wanted from an FTP site to my local computer. However, I have found this task very frustrating in Xbasic. Is there any kind of FTP command I am unaware of? How do people normally go about downloading files through an Alpha 5 script? This seems like it would be a pretty common task.

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,699

    Default RE: Downloading files from FTP site

    Sarah, Alpha Five Version 6 will have FTP capabilities built in, but Version 5 does not. If you try searching the board you will find a few discussions of how this can be accomplished using external FTP programs.

    -Lenny

  3. #3
    Sarah Mengesha
    Guest

    Default RE: Downloading files from FTP site

    Thanks Lenny,

    Yes, I did see a posting regarding the ftp program WCL_FTP. I downloaded it, but I can't seem to get the command line arguments right. I am inserting them after the filename in the Target Field. Is this correct? For some reason, it gives me the error that '1' is not a valid integer. But I don't have '1' in the command line. Kind of confused if anyone can help. :(

    Sarah

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,699

    Default RE: Downloading files from FTP site

    I'm not familiar with WCL_FTP, sorry.

    Windows also has a command-line FTP program as well that you could try and the command-line syntax is documented in the MS knowledge base.

    -Lenny

  5. #5
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: Downloading files from FTP site

    Sarah,

    WCL_FTP works beautifully but you do have to watch the syntax. Everything is sent as a character string (duh! hard to have a command line without characters!) and it requires 9 arguments. Arguments 10-14 are optional.

    Here's the 'syntax' I use:
    ""path>wcl_ftp.exe" "file_to_send" "window_title" "site_name.com" "user_name" "pswrd" "web_folder" "host_file" "upld_file" "put 1 0 0"

    Or, more precisely:
    send_str = "\"" + wcl_file + "\" \"" + window_title + "\" \"" + site_name + "\" \"" + user + "\" \"" + pswrd + "\" \"" + web_dir + "\" \"" + host_file + "\" \"" + upld_file + "\" put 1 0 0"

    sys_shell(send_str)

    Where each of the 'names' such as wcl_file and window_title are variables that hold that actual value to be used.

    (Note that the 'send_str' is word wrapped here but can't be wrapped in xbasic.)

    The purpose of all the quotes is to take care of possible blank spaces in file and/or folder names. Without the quotes, it would read:
    C:\Program Files\wcl_ftp.exe My File My Window Name....
    and think that C:\Program was the program to be run, Files\wcl_ftp.exe was the first argument, My was the second argument and so on. Obviously, this won't work very well at all!

    Can I ask what your are using this for? Personal use or an app you are building for someone else?

    Cal Locklin
    www.aimsdc.net

  6. #6
    Sarah Mengesha
    Guest

    Default RE: Downloading files from FTP site

    Cal,

    Thanks for the command line syntax info for WCL_FTP, I was becoming very frustrated for a minute there. This is an app I am building for my company. It is supposed to download record files and summarize the data into billing files. The only problem I am having now is that the files I am downloading are assigned random extensions. Well, not exactly random, they are sequential, but there are plenty of duplicate extension names, (i.e., .203, .304). So, I need a way to specify the file name, and have a wildcard extension, say D20040501*.* . This will not work with many FTP commands, as you are probably aware of.

    Sarah

  7. #7
    "Certified" Alphaholic
    Real Name
    Cal Locklin
    Join Date
    Mar 2000
    Location
    S.E. Michigan
    Posts
    5,763

    Default RE: Downloading files from FTP site

    You'll note that I said "Where each of the 'names' such as wcl_file and window_title are variables ..."

    Determining the extension (i.e., the full file name) is basically 'your' responsibility because the FTP command can only send one file at a time and requires the full name. If you can figure out a logic to determine the file extension, save the name to a variable and use the variable in the FTP command. Use a loop to if necessary to submit multiple files.

  8. #8
    Gregory R. Zilliox
    Guest

    Default RE: Downloading files from FTP site

    Sarah,
    What you want to do is use the built in FTP command in Windows.
    After you have logged on to the FTP site issue the prompt
    command. This will turn off prompting.
    Then issue the mget command D20040601*.*
    this will download all of the file that match without prompting.I setup a .cmd file that has the FTP script in it.
    Example:
    This is the ftpresdepx.cmd:
    @echo off
    g:
    cd\flexmbi\uploads
    ftp -s:ftpresdepx.fil 12.44.222.84

    Here is the ftpresdepx.fil:
    paambi01 --"" userid
    zx932xx --"" password
    cd medibank
    cd mbi3200
    prompt
    mget deposits*.*
    quit

    This works perfectly. Let me know if you need anything else
    Greg

Similar Threads

  1. Downloading the v7 beta
    By Lenny Forziati in forum Alpha Five Version 7
    Replies: 0
    Last Post: 09-21-2005, 06:40 PM
  2. Downloading New Help File
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-03-2004, 02:13 PM
  3. Trouble downloading patch
    By Wanda Tucker in forum Alpha Five Version 5
    Replies: 2
    Last Post: 02-24-2003, 09:45 AM
  4. Downloading Patches
    By Ron Cottrell in forum Alpha Five Version 4
    Replies: 1
    Last Post: 03-03-2001, 09:18 AM
  5. Downloading from this board
    By Selig Starr in forum Alpha Five Version 4
    Replies: 14
    Last Post: 04-21-2000, 06:42 PM

Bookmarks

Posting Permissions

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