2

Is there any way to add file upload functionality in G-suite app maker?

If any one have any idea please help.

TestUser
  • 45
  • 7

1 Answers1

2

You have a couple options. (I recommend the first approach because it's by far the easiest, but I went into detail on the second one because I think it's cool ;)

The easiest is to use the Drive Picker widget and enable the upload feature, which will upload the file to the user's drive and provide a link to it (from there you could do whatever you wanted with the file from a Server script).

Alternatively, you could use the HTML widget to create an upload form. Apps Script has a cool bit of functionality that if you pass a form with a file upload element in it to the server, then it sends the blob of the uploaded form to the server script. This post has a decent example of that in Apps Script: Uploading file using Google Apps Script using HtmlService

I haven't tried this, but here are some App Maker specific instructions based on that example:

Create an html widget, click "Allow unsafe HTML" (because we're adding a script to the HTML) and then add this html to it:

And then in a Server Script named serverFunc you can do whatever you want with the blob.

Community
  • 1
  • 1
Devin Taylor
  • 825
  • 5
  • 11