0

I have a project on Google App Scripts connected to my drive. I was able to save and organize my files (from mail) and directories in the drive using the script. now, I want to save the files to an FTP server and cannot find the References to do so.

how do I access an ftp server, create folders and upload files to them ?

thanks

1

2 Answers 2

1

It seems this is not possible. If you check this Class UrlFetchApp, app script only supports HTTP and HTTPS communication over the internet. A supporthing SO thread seems to confirm this.

Sign up to request clarification or add additional context in comments.

Comments

0

The workaround to go from GAS -> FTP is as follows. I've been using this method for a number of years in production.

  1. From apps script, save the file to google drive
  2. Using Zapier, trigger to copy new filesfrom the google drive folder to a DropBox folder
  3. Using Microsoft Flow, trigger to copy new files from the Dropbox folder to an FTP or SFTP location.

You can probably do step 3 in Zapier as well. I use Microsoft Flow because I already had a significant number of automated tasks setup there. For Step, 2, I use Zapier because MS flow does not yet have a built-in trigger available based on a new file being saved to google drive. You would have to make your own custom trigger using the google drive API's.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.