google-apps-scriptfile-uploadadd-ongoogle-workspace-add-ons

How to implement File Upload Functionality using Card Services in Gmail Add-on


I'm currently working on developing a Gmail add-on using Card Services and I'm facing some challenges regarding implementing a file upload functionality within the add-on. I would greatly appreciate your insights and expertise on this matter.

My goal is to allow users to upload files directly within the Gmail add-on's card interface. I've looked through the Card Services documentation, but I couldn't find a clear example or guidance on how to achieve this specific functionality.

Here are the key points I'm trying to address:

  1. How can I create a file upload input element within a Card in a Gmail add-on using Card Services?
  2. Once the user selects a file, how do I capture and handle the uploaded file within the add-on's code?
  3. Are there any best practices or considerations I should consider when implementing file uploads in Gmail add-ons using Card Services?

Any code examples, documentation references, or general guidance would be immensely helpful. I'm open to any insights you can provide, as I'm still relatively new to developing Gmail add-ons and Card Services.


Solution

  • Currently, Google Card Service does not offer functionality for file input. While there exists a feature request for this capability, it appears to be in a stagnant state (only assigned), with no visible progress. If you believe this feature is important, you can comment on the issue to let Google know and possibly make it a higher priority.

    As a workaround approach, you might consider presenting users with a URL for uploading on your own website. After uploading, users can enter the link or ID into the designated input field in your card service.