[GH-ISSUE #1247] send attachment + a message with curl #880

Closed
opened 2026-05-07 00:28:25 +02:00 by BreizhHardware · 4 comments

Originally created by @dev72 on GitHub (Dec 27, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1247

Hello,
if I use che ntfy cli I can send a file and set a custom message.
Is there a way to do the same via curl?

Is there a value I can set in attachment-expiry-duration to never delete attachments?

Thank you.

Originally created by @dev72 on GitHub (Dec 27, 2024). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1247 Hello, if I use che ntfy cli I can send a file and set a custom message. Is there a way to do the same via curl? Is there a value I can set in attachment-expiry-duration to never delete attachments? Thank you.
BreizhHardware 2026-05-07 00:28:25 +02:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@wunter8 commented on GitHub (Dec 28, 2024):

if I use che ntfy cli I can send a file and set a custom message.
Is there a way to do the same via curl?

You can use this example to attach a local image: https://docs.ntfy.sh/publish/#__tabbed_24_1

To set a custom message, add -H "Message: your message here

Is there a value I can set in attachment-expiry-duration to never delete attachments?

The value has to be non-zero to store attachments, but you can make it save files for years. "Days" is the largest granularity that works. So you could do 1825d for 5 years.

<!-- gh-comment-id:2564116850 --> @wunter8 commented on GitHub (Dec 28, 2024): > if I use che ntfy cli I can send a file and set a custom message. Is there a way to do the same via curl? You can use this example to attach a local image: https://docs.ntfy.sh/publish/#__tabbed_24_1 To set a custom message, add `-H "Message: your message here` > Is there a value I can set in attachment-expiry-duration to never delete attachments? The value has to be non-zero to store attachments, but you can make it save files for years. "Days" is the largest granularity that works. So you could do `1825d` for 5 years.
Author
Owner

@dev72 commented on GitHub (Dec 28, 2024):

Thank you.
Can I attach more thank one file in a request?

<!-- gh-comment-id:2564336694 --> @dev72 commented on GitHub (Dec 28, 2024): Thank you. Can I attach more thank one file in a request?
Author
Owner

@wunter8 commented on GitHub (Dec 28, 2024):

No, you can't. So if you want to send multiple files, they need to be zipped or archived into a single file first

<!-- gh-comment-id:2564338021 --> @wunter8 commented on GitHub (Dec 28, 2024): No, you can't. So if you want to send multiple files, they need to be zipped or archived into a single file first
Author
Owner

@dev72 commented on GitHub (Dec 28, 2024):

ok, thank you very much.

<!-- gh-comment-id:2564361896 --> @dev72 commented on GitHub (Dec 28, 2024): ok, thank you very much.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#880
No description provided.