0

We have an issue with a FTP site that fails intermittently. Upon notification that a connection cannot be established we manually log into a website and upload our file. We have no idea why the FTP site fails and it is not under our control. This community has some good ideas so I am asking if a website (http) can be logged into programmatically and files can be uploaded to or downloaded from that website in a manner similar to ftp. No API available from this vendor.

Brian Evans
  • 235
  • 1
  • 4
  • 21

1 Answers1

2

You did not give specifics about your environment or how you wish to implement your uploads. There are many tools available on most platforms to programmatically upload files, so I'll just mention a few general tips.

There is a very useful Linux GNU shell utility, wget: https://www.gnu.org/software/wget/, that has been available for a very long time. This utility has a command line interface which can easily be accessed programmatically from scripts using exec or other shell commands, to upload files via HTTP and FTP.

It's not as common, but there is a corresponding utility, wput: http://wput.sourceforge.net/, that is used to upload files.

If you only have access to Windows computers, a similar functionality is available from the Windows PowerShell (it's built in). Here is an old SO post with examples of how to do it with PowerShell: How to script FTP upload and download?

Another Windows based utility is WINSCP: https://winscp.net/eng/docs/guide_automation.

In answer to your question, these utilities wget/wput, PowerShell, and WINSCP, could be used to programmatically upload and download files to your FTP site. You could write (or have written) a custom script that automatically retries in the event that you get failures from your flaky FTP site.

ByteSlinger
  • 1,439
  • 1
  • 17
  • 28