Apps Script and SFTP

瀏覽次數:1,377 次
跳到第一則未讀訊息

Laurie Nason

未讀,
2021年10月7日 凌晨1:03:362021/10/7
收件者:google-apps-sc...@googlegroups.com
Hi all,
Just wondering if anyone knows if apps script can use sftp to create a file on a remote server? I have googled and the consensus (at least in the articles I read) was no, there's no facility to do that. There are various helper (paid for) linkers that say they will do it, but was wondering if there was any native solution yet?
Laurie

dimud...@gmail.com

未讀,
2021年10月7日 下午5:37:452021/10/7
收件者:Google Apps Script Community
As far as I know, its not currently possible to connect to a SFTP server directly from Apps Script. You'd have to use an intermediary service. I've used Cloud Functions (written in NodeJS which supports FTP) to do this in the past. Cloud Functions can be deployed as HTTP endpoints that you can call out to from Apps Script.

Clark Lind

未讀,
2021年10月8日 晚上7:59:582021/10/8
收件者:Google Apps Script Community
Not directly. In fact, it seems that javascript would have a hard time doing it too. However, if you have a server that you interact with using JS or GAS, PHP may be able to do it for you:
https://techtalkbook.com/file-upload-via-sftp-using-php/

Some of the advanced services show PHP as one of the client libraries, so you just might be able to figure something out. It just won't be a "direct" solution; e.g., use GAS to load a file to a server, that server uses PHP to send the file to another server via SFTP, etc.

On Thursday, October 7, 2021 at 1:03:36 AM UTC-4 Laurie Nason wrote:
回覆所有人
回覆作者
轉寄
0 則新訊息