I have MMA-generated html and would like to automate uploading to a named directory to a web host via SFTP or HTTP POST, ideally without creating local temp files. The closest question I could find on MMA.SE is this question which doesn't really address this issue.
Based on this "minimal http upload gci" in Python, and HTTP Request-Authentication flow-chart, it seems that uploading by FTP may be relatively easier. Sjoerd C. de Vries suggested this question may answer the POST part.
Others have found FTP in non-interactive mode to be difficult. But one would think authentication, put and closing the session in interactive mode could be managed within MMA.
However, Run is not meant to capture output from the external program. From the sparse documentation, I think RunThrough
is meant to capture external program output, but I can only manage to capture an exit condition code:
RunThrough["sftp", "####@understars.org:temp.understars.org"]
Doesn't output to the front end, but does set the Out[] to 256.
So how can an interactive FTP session be automated?
(Note I've tagged this "html" as well since ultimately that is what I want to export.)
sftp
wants its destination as command line argument, not as standard input. Maybe you'll have more success withRunThrough["sftp ####@understars.org:temp.understars.org","commands to execute"]
$\endgroup$