0

I am using google drive file picker in HTML web app, it's working perfectly fine with a single button, I am trying to add a 2nd button to upload the files and save in a different folder.

Please find my complete script in below sheet, please help me to fix or achieve the requirement

Smaple Sheet with Code enter image description here

2 Answers 2

1

You have used the same function name for picker 2. Change the function name so that app script can distinguish it.

In Code.gs change the change the 5th function name from initPicker to initPicker2 and in javascript2.html make the below changes.

function openPicker2() {
  google.script.run
  .withFailureHandler(showMessage)
  .withSuccessHandler(showFilePicker)
  .initPicker2();
}

function openUploader2() {
  google.script.run
  .withFailureHandler(showMessage)
  .withSuccessHandler(showFileUploader)
  .initPicker2();
}
Sign up to request clarification or add additional context in comments.

1 Comment

@ Ritz Thanks Yes, able to upload the files
0

In saving, try using Save to Drive Button.

As discussed in the documentation, include the necessary JavaScript resource and to add the Save to Drive button tag:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-savetodrive"
   data-src="//example.com/path/to/myfile.pdf"
   data-filename="My Statement.pdf"
   data-sitename="My Company Name">
</div>

With this, you can place multiple buttons per page which is implemented sequentially.

See documentation to learn more.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.