From 4fa06554382b32365a10dd1bb07f7cfa3d83ba6c Mon Sep 17 00:00:00 2001
From: Hunter Kehoe <hunter.kehoe@gmail.com>
Date: Sun, 14 May 2023 11:19:49 -0600
Subject: [PATCH 1/2] set attachment filename when download through browser

---
 server/server.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/server.go b/server/server.go
index c0ebc6eb..05b77d57 100644
--- a/server/server.go
+++ b/server/server.go
@@ -642,6 +642,9 @@ func (s *Server) handleFile(w http.ResponseWriter, r *http.Request, v *visitor)
 		return err
 	}
 	defer f.Close()
+	if m.Attachment.Name != "" {
+		w.Header().Set("Content-Disposition", "attachment; filename="+strconv.Quote(m.Attachment.Name))
+	}
 	_, err = io.Copy(util.NewContentTypeWriter(w, r.URL.Path), f)
 	return err
 }

From 028f3aad14209c0a6bba1ad5ac002978333ae5d9 Mon Sep 17 00:00:00 2001
From: Hunter Kehoe <hunter.kehoe@gmail.com>
Date: Sun, 14 May 2023 11:23:58 -0600
Subject: [PATCH 2/2] release notes

---
 docs/releases.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/releases.md b/docs/releases.md
index 266882a7..602d2619 100644
--- a/docs/releases.md
+++ b/docs/releases.md
@@ -1185,6 +1185,7 @@ and the [ntfy Android app](https://github.com/binwiederhier/ntfy-android/release
 * Removed old ntfy website from ntfy entirely (no ticket)
 * Fix potential subscriber ID clash ([#712](https://github.com/binwiederhier/ntfy/issues/712), thanks to [@peterbourgon](https://github.com/peterbourgon) for reporting, and [@dropdevrahul](https://github.com/dropdevrahul) for fixing)
 * Support for `quoted-printable` in incoming emails ([#719](https://github.com/binwiederhier/ntfy/pull/719), thanks to [@Aerion](https://github.com/Aerion))
+* Attachments with filenames that are downloaded using a browser will now download with the proper filename ([#726](https://github.com/binwiederhier/ntfy/issues/726), thanks to [un99known99](https://github.com/un99known99) for reporting, and [@wunter8](https://github.com/wunter8) for fixing)
 
 ### ntfy Android app v1.16.1 (UNRELEASED)