I would like to use Mathematica to create some simple web pages. I prefer not to use CloudDeploy because I can host these pages more cheaply locally and they have no interactivity. Generating a page is easy enough with Export["filename.html",#] and it seems as though uploading should be easy with a combination of CopyFile[] and RemoteFile[], specifically something like this:
destinationURL = URL["sftp://sterno.pairserver.com/test.txt"];
destinationRF = RemoteFile[destinationURL,
Authentication -> <|"Username" -> XXXX, "Password" -> YYYY|>];
CopyFile[FileNameJoin[{NotebookDirectory[], "test.txt"}](*from*), destinationRF(*to*)]
I’ve tried on two different servers — one local and one remote, both reachable by sftp and graphical sftp clients. I’ve tried specifying the destination filename and providing just the destination directory. If I specify the name, I get
::URL : Cannot open remote file: /test.txt
and if I don’t, I get
::URL : Cannot open remote file: /.
What am I missing?
CopyFilecould be useful. It supports an SFTP destination file. Since you have control on the destination server, maybe you could make that work. – MarcoB Jun 03 '20 at 05:35