Unable to upload a PDF/IMAGE/ANy file to AWS S3 bucket

18 views
Skip to first unread message

Darren D'Mello

unread,
Jul 22, 2021, 8:22:05 AM7/22/21
to Google Apps Script Community
I am trying to upload a blob (PDF or image) from a Google Drive to AMazon AWS S3 bucket.

But I am unable to upload to my bucket

I have tried with

Here is my project file (Code.gs)

function doGet() {
S3.init("Access_key", "Secret_access_key");
var fileId = "1Nb3Tbj8nZzlluRKlMP24ImlUz7515IgH";
var region = "us-east-2";
var blob = DriveApp.getFileById(fileId).getBlob();
S3.putObject("test-bucket", blob.getName(), blob, region);
}

Could anyone help me please.

Thanks

Martin Hawksey

unread,
Jul 22, 2021, 5:28:06 PM7/22/21
to google-apps-sc...@googlegroups.com
Hi Darren - have you tried other S3 libraries, like this one https://github.com/eschultink/S3-for-Google-Apps-Script (includes some test scripts to check it's working - related post https://engetc.com/projects/amazon-s3-api-binding-for-google-apps-script/

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/dc5db48b-5fcc-47bb-b3e1-d47da4f523b8n%40googlegroups.com.


--
Martin Hawksey

Latest tweet (see how):

We were so busy curating content on https://t.co/7jc3xzylee that we missed marking 500 posts! Thank you to the #GoogleAppsScript community for sharing so many resources for us to collect. #AppsScript / #WorkspaceDevs pic.twitter.com/PJiJiIvY9I

— AppsScriptInfo (@AppsScriptInfo) June 1, 2021

Darren D'Mello

unread,
Jul 23, 2021, 5:58:58 AM7/23/21
to google-apps-sc...@googlegroups.com
Thanks Martin. I really appreciate your help.

That didn't work for me. But it led me to find a way for POST requests and that worked.



--
Best,
Darren
Reply all
Reply to author
Forward
0 new messages