# Gmail attachments to Drive and Telegram

Upload new Gmail attachments to sender/date folders in Google Drive, make each file readable by anyone with its link, then send that link to Telegram. Review both the sharing permission and chat destination before activation.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=gmail-attachments-to-drive-telegram&templateName=Gmail+attachments+to+Drive+and+Telegram)

**Required accounts**

- Gmail
- Google Drive
- Telegram Bot

## From an email attachment to a public Drive link in Telegram

### 1. Trigger · New Attachment Received

**Gmail**. Poll received Inbox messages and emit one event per non-inline attachment. Eligible attachments waiting in a backlog continue across later runs.

### 2. Action · Create sender/date folder

**Google Drive**. Find or create fasthook\_public\_attachments/\{sender folder\}/\{received date\} using the Gmail trigger’s sender and date values.

### 3. Action · Upload attachment

**Google Drive**. Upload the trigger’s File to the returned sender/date folder and retain the uploaded file’s webViewLink for the final message.

### 4. Action · Make attachment public

**Google Drive**. Grant anyone reader access to the uploaded file. This makes it readable to anyone who obtains its link, including people outside the Telegram chat.

### 5. Action · Send public link to Telegram

**Telegram Bot**. Send the uploaded file’s Drive webViewLink as the entire message to your chosen Chat Id. The prepared message contains no email subject, sender summary or binary attachment.

## A shared Drive file and its link in your chat

Each successful attachment event uploads a file, grants public-link reader access and sends the uploaded file’s viewing URL to Telegram.

**Illustrative Telegram message**

```
https://drive.google.com/file/d/FICTIONAL_FILE_ID/view
```

Fictional URL. The file sits under fasthook\_public\_attachments/\{sender\}/\{received date\}. Its access is not limited to chat members: anyone who obtains the link can read it.

## Set up your workflow

1. **Select which Gmail attachments to process** Connect the receiving Gmail mailbox and review search and label filters. One event is emitted for each non-inline Inbox attachment, so a message can produce several uploads and Telegram messages.
2. **Review the public-file permission** Connect Drive for the folder, upload and sharing steps. Review the fasthook\_public\_attachments path and anyone/reader permission. Change the sharing design before activation if these files should remain private; changing only the Telegram chat does not restrict file access.
3. **Choose Telegram and test with fictional content** Connect the FastHook Telegram bot and select a Chat Id where it can post. Activate after reviewing sharing, then send a fictional attachment and check its Drive permission and the link-only Telegram message after polling.

## Details and limitations

- **The link can be read outside Telegram.** The workflow explicitly grants anyone reader access. A private chat or folder does not narrow that file permission. Anyone receiving or forwarding the link can read the shared file, subject to the permission being allowed by Drive policy.
- **The prepared destination message is only a URL.** Telegram receives the upload’s webViewLink, not the file bytes, subject, sender or a formatted summary. Review that field if you want a different message.
- **Later failures do not reverse earlier file actions.** If sharing fails, an upload can remain. If Telegram fails after sharing, the file can already be publicly readable. The recipe has no rollback, existing-file lookup or automatic permission-revocation step.
- **One attachment per event.** Inline images are excluded. Multiple eligible attachments can produce several files and chat messages, and pending backlogs can continue across polls. Manual reruns can upload and announce another copy.

## Questions about this template

### Can only members of my Telegram chat read the file?

No. The prepared Drive action grants anyone with the link reader access. Chat membership does not restrict the file permission. Review sharing before activation.

### Does the bot send the attachment itself or an email summary?

Neither is prepared. It sends only the uploaded Drive file’s webViewLink as the message text.

### Where are attachments stored?

Under fasthook\_public\_attachments/\{sender folder\}/\{received date\} in Drive. The folder action reuses an existing path or creates missing folders before upload.

### What if Telegram fails after the file has been shared?

The upload and sharing have already happened and can remain in place. The recipe does not revoke permissions or delete the file when the later Telegram step fails.

## Related integrations

- [Gmail integrations](https://www.fasthook.io/apps/gmail/integrations)
- [Google Drive integrations](https://www.fasthook.io/apps/google-drive/integrations)
- [Telegram integrations](https://www.fasthook.io/apps/telegram/integrations)
- [Gmail and Google Drive workflows](https://www.fasthook.io/apps/gmail/integrations/google-drive)
- [Gmail and Telegram workflows](https://www.fasthook.io/apps/gmail/integrations/telegram)

## Related workflow templates

- [Send Telegram alerts for matching Gmail emails](https://www.fasthook.io/templates/gmail-search-emails-to-telegram.md): Stay informed about priority inbox messages without forwarding whole emails.
- [Save Gmail attachments to Google Drive](https://www.fasthook.io/templates/gmail-attachments-to-drive.md): Save each new Gmail attachment in Google Drive, organized by sender and received date, then make the uploaded file readable by anyone with its link.
