简体   繁体   中英

Google Apps Script: file upload progress indicator

Has anybody implemented file upload progress indicator in Google Apps add-on (eg in sidebar or dialog)?

I tried to use JQuery Form plugin but it seems that IFRAME sandbox mode doesn't allow to use it. And the NATIVE mode is deprecated and will be shut down soon.

Is there any other solution to display upload progress bar in dialog or sidebar in Google Spreadsheet add-on?

Thank you!

Unfortunately this currently isn't possible in Apps Script. In order to have a progress indicator the request needs to provide a event you can listen to for progress, and google.script.run currently does't provide a progress event (just success and failure).

As @Eric Koleda said it's not possible unfortunatelly.

But you can fake it if you're uploading several files by using google.run.withSuccessHandler() function to update your progress bar every time a file has been uploaded. So percent = uploaded files / total of files * 100

google.run.withSuccessHandler(updateProgressBar).serverSideFunctionToUpload(parameters)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM