Alpha Video Training
Results 1 to 6 of 6

Thread: SFTP

  1. #1
    Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,768

    Default SFTP

    I am in need of an automated SFTP procedure. Alpha provides FTP utilities, but as far as I know, not SFTP.

    I have been using FTP Voyager which works quite well for SFTP. I have been using the GUI, but I would like to use the command line options to fully automate the process. I can't get it to work despite trying for weeks. The process completes and I get a msg that the process succeeded, but the file is not on the server - or maybe it is, but it's not where I (think I) put it.

    I have also used Filezilla, but there are very few command line options, and none that would allow you to upload or download files.

    I have come across Winscp which my reading tells me should work as well, but looks like a new learning curve.

    Has anyone had success in automatic SFTP upload and download with ANY product?
    Gary S. Traub, Ph.D.


  2. #2
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    205

    Default Re: SFTP

    Hey there,

    I tried for a while on this and decided to just do it manually using FileZilla. I think what you would have to do, which I haven't wanted to do, is create your own script that could run on your local dev machine which would check for updates to files, then run it's own code to publish the files. Someone may have actually done this in a way that could be run by the alpha dev server using xbasic, but I haven't found it. Does seem like a bit of hole in the process doesn't it?

  3. #3
    Moderator drgarytraub's Avatar
    Real Name
    Dr. Gary Traub
    Join Date
    May 2000
    Location
    Boca Raton, FL
    Posts
    2,768

    Default Re: SFTP

    Yes.
    Gary S. Traub, Ph.D.


  4. #4
    "Certified" Alphaholic NoeticCC's Avatar
    Real Name
    Andrea Gill
    Join Date
    Nov 2007
    Location
    Golcar, West Yorkshire, UK
    Posts
    2,069

    Default Re: SFTP

    I have used SFTP using cURL and winSCP to download and move PDFs and CSV files nightly for some months now, with the script running in a runtime instance every night. It's a roundabout way and may be possible to do without running it via .bat and .txt command file although it has been useful to have the trace of which files were downloaded on what date. I should imagine the basic principle might work too from browser-based applications, or if it is something that can be run automatically every night then move that into a runtime app that runs on the server.

    cURL -listonly with output to a text file, then iterate through each file found to first download then (re)move the file. I have not been able to get this to work without passing in the certificate code, so will have to set something up to grab the new certificate details as and when they change.

    DIM FTPAddress as C
    FTPAddress = "ftps://{username}:{password}@{ftpsaddress}/"

    run("curl -k -listonly " + FTPAddress + " --output " + FTPLocalRoot + cFolderName + "" + curListFileName)


    I write a batch file that runs a text file with commands starting with the below.

    FTPCommandDownload = evaluate_string(<<%txt%
    open -certificate="{CertificateNo}" {FTPAddress}
    option batch on
    option confirm off
    %txt%)

    then for each file

    FTPCommandDownload = FTPCommandDownload + evaluate_string(<<%txt%
    get "{fileNameDL}" "{FTPLocalRoot}{cFolderName}\%txt% + fileNameDL + """") + crlf()

    then at the end

    FTPCommandDownload = FTPCommandDownload + "exit"

    Save the .bat file under a unique name and save a text file with the code.

    File.from_string(FTPLocalRoot + "Scripts\DLBatch_" + cFolderName + "_" + vc_Today + ".txt",FTPCommandDownload)
    File.from_string(FTPLocalRoot + "Scripts\DLRun_" + cFolderName + "_" + vc_Today + ".bat",""C:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /script=" + FTPLocalRoot + "Scripts\DLBatch_" + cFolderName + "_" + vc_Today + ".txt")

    Then run the batch files which calls the text file with the commands.

    run(FTPLocalRoot + "Scripts\DLRun_" + cFolderName + "_" + vc_Today + ".bat")


    If files need moving/removing too then rm or mv commands can also be used in the same file. Haven't done uploads yet but would imagine the WinSCP commnds should work just fine for that too.
    Last edited by NoeticCC; 12-13-2017 at 03:43 AM.

  5. #5
    "Certified" Alphaholic
    Real Name
    eric
    Join Date
    Mar 2009
    Location
    Amsterdam
    Posts
    1,284

    Default Re: SFTP

    Quote Originally Posted by drgarytraub View Post
    I am in need of an automated SFTP procedure. Alpha provides FTP utilities, but as far as I know, not SFTP.

    I have been using FTP Voyager which works quite well for SFTP. I have been using the GUI, but I would like to use the command line options to fully automate the process. I can't get it to work despite trying for weeks. The process completes and I get a msg that the process succeeded, but the file is not on the server - or maybe it is, but it's not where I (think I) put it.

    I have also used Filezilla, but there are very few command line options, and none that would allow you to upload or download files.

    I have come across Winscp which my reading tells me should work as well, but looks like a new learning curve.

    Has anyone had success in automatic SFTP upload and download with ANY product?

    Gary check this https://www.rssbus.com/apps/ports/sftp the have more but i can see see u need the client or server


    out of the box hippa trusted https://www.rssbus.com/mft/
    run under iis or standalone
    Last edited by bea2701; 12-13-2017 at 05:51 AM. Reason: edit

  6. #6
    VAR
    Real Name
    Mike Reed
    Join Date
    Apr 2000
    Location
    Phoenix, AZ
    Posts
    650

    Default Re: SFTP

    The one we use is from sysax. Here is the link: https://www.sysax.com/index.htm

    The standard license is adequate for simple SFTP transfers and works well.

    Mike
    Mike Reed
    Phoenix, AZ

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
  •