1
0
Fork 0
forked from mirrors/ntfy
This commit is contained in:
Philipp Heckel 2022-01-13 15:47:34 -05:00
parent 034c81288c
commit 6a7b20e4e3
2 changed files with 6 additions and 8 deletions

View file

@ -517,7 +517,7 @@ The format for a *size* is: `<number>(GMK)`, e.g. 1G, 200M or 4000k.
```
$ ntfy serve --help
NAME:
main serve - Run the ntfy server
ntfy serve - Run the ntfy server
USAGE:
ntfy serve [OPTIONS..]

View file

@ -660,7 +660,7 @@ Here's an example that will open Reddit when the notification is clicked:
```
## Attachments
You can send images and other files to your phone as attachments to a notification. The attachments are then downloaded
You can **send images and other files to your phone** as attachments to a notification. The attachments are then downloaded
onto your phone (depending on size and setting automatically), and can be used from the Downloads folder.
There are two different ways to send attachments:
@ -669,7 +669,7 @@ There are two different ways to send attachments:
* or by [passing an external URL](#attach-file-from-a-url) as an attachment, e.g. `https://f-droid.org/F-Droid.apk`
### Attach local file
To send an attachment from your computer as a file, you can send it as the PUT request body. If a message is greater
To **send a file from your computer** as an attachment, you can send it as the PUT request body. If a message is greater
than the maximum message size (4,096 bytes) or consists of non UTF-8 characters, the ntfy server will automatically
detect the mime type and size, and send the message as an attachment file. To send smaller text-only messages or files
as attachments, you must pass a filename by passing the `X-Filename` header or query parameter (or any of its aliases
@ -701,6 +701,7 @@ Here's an example showing how to upload an image:
PUT /flowers HTTP/1.1
Host: ntfy.sh
Filename: flower.jpg
Content-Type: 52312
<binary JPEG data>
```
@ -750,15 +751,13 @@ Here's what that looks like on Android:
</figure>
### Attach file from a URL
Instead of sending a local file to your phone, you can use an external URL to specify where the attachment is hosted.
Instead of sending a local file to your phone, you can use **an external URL** to specify where the attachment is hosted.
This could be a Google Drive or Dropbox link, or any other publicly available URL. The ntfy server will briefly probe
the URL to retrieve type and size for you. Since the files are externally hosted, the expiration or size limits from
above do not apply here.
To attach an external file, simple pass the `X-Attach` header or query parameter (or any of its aliases `Attach` or `a`)
to specify the attachment URL. It can be any type of file.
Here's an example showing how to upload an image:
to specify the attachment URL. It can be any type of file. Here's an example showing how to upload an image:
=== "Command line (curl)"
```
@ -820,7 +819,6 @@ Here's an example showing how to upload an image:
<figcaption>File attachment sent from an external URL</figcaption>
</figure>
## E-mail notifications
You can forward messages to e-mail by specifying an address in the header. This can be useful for messages that
you'd like to persist longer, or to blast-notify yourself on all possible channels.