Assigned
Status Update
Comments
[Deleted User] <[Deleted User]> #2
CC me
da...@gmail.com <da...@gmail.com> #3
So there's a way around it.
It is possible to create a Modal with HTML code where the file can be uploaded, data retrieved and send to GS functions.
const showModalForFile = () => SpreadsheetApp.getUi().showModalDialog ( HtmlService.createTemplateFromFile('myModalHtmlFile') ,'Upload a file')
and then in "myModalHtmlFile" :
<input id="templateFileInput" type="file" >
<script>
const templateFileInput = document.getElementById('templateFileInput')
const manageFileReader = () => {
try{
const fr = new FileReader()
fr.onload = async () => { alert(fr.result) } // <---------------------- Your content is here and you can perform other functions
fr.readAsText(templateFileInput.files[0]);
}catch(e){
alert(`error : ${e}`)
}
return null
}
const submitFileContent = (e) => {
e.preventDefault();
manageFileReader()
}
templateFileInput.addEventListener('input',submitFileContent)
</script>
It is possible to create a Modal with HTML code where the file can be uploaded, data retrieved and send to GS functions.
const showModalForFile = () => SpreadsheetApp.getUi().showModalDialog ( HtmlService.createTemplateFromFile('myModalHtmlFile') ,'Upload a file')
and then in "myModalHtmlFile" :
<input id="templateFileInput" type="file" >
<script>
const templateFileInput = document.getElementById('templateFileInput')
const manageFileReader = () => {
try{
const fr = new FileReader()
fr.onload = async () => { alert(fr.result) } // <---------------------- Your content is here and you can perform other functions
fr.readAsText(templateFileInput.files[0]);
}catch(e){
alert(`error : ${e}`)
}
return null
}
const submitFileContent = (e) => {
e.preventDefault();
manageFileReader()
}
templateFileInput.addEventListener('input',submitFileContent)
</script>
se...@google.com <se...@google.com> #4
Hi,
This feature request has been forwarded internally.
Regards.
is...@google.com <is...@google.com>
jp...@google.com <jp...@google.com>
if...@gmail.com <if...@gmail.com> #5
I'm also facing this issue.
jp...@google.com <jp...@google.com> #6
Because this feature request is over 3 years old and has five or fewer votes, I am closing it to better prioritize requests from developers. Please note that this request will still be used to inform future roadmap decisions.
If this is a critical issue, please comment here and I will triage the feature request. Thank you for your patience in addressing the backlog of issues and improving processes around feedback.
If this is a critical issue, please comment here and I will triage the feature request. Thank you for your patience in addressing the backlog of issues and improving processes around feedback.
jp...@google.com <jp...@google.com>
ja...@insurmagic.de <ja...@insurmagic.de> #7
What is the current state here?
Description
Add a file input widget to the card service.
What is the purpose of this new feature?
Allow a user to upload a file with an add-on, e.g to add an email attachment or insert images into Google Docs/Sheets/Slides.
What existing Apps Script services or other resources would this affect?
The card service.
What existing data does this use?
None?
Please provide any additional information below.
I would like to add a way to upload files and use them as attachments to Gmail emails from my Gmail add-on. I can imagine a similar feature could be useful for other add-ons, e.g inserting and manipulating images in Google Docs/Sheets/Slides or uploading files to Google Drive/other file hosting services.
Having an input that allows to select and upload files would be required for this. Supporting drag-and-drop would be nice to have.