uintdev / qrserv

Transfer files with ease over a network.
https://play.google.com/store/apps/details?id=dev.uint.qrserv
MIT License
135 stars 9 forks source link

Optional inclusion of file name in path #2

Closed uintdev closed 3 years ago

uintdev commented 3 years ago

QRServ allows the downloading of files without placing a file name in the path. To let the browser know what the file name is, the Content-Disposition header carries the file name. The benefit of doing this is that the path could stay perfectly static and the user could reload (or send a request) on each new file selection.

It sounds very fancy and all, but there is a problem with this approach. It's not one-size-fits-all. In Safari, when requesting media (images, videos), it tries displaying them instead of downloading right away. The browser would not take the file name in the Content-Disposition header when using the download option, meaning it can instead use the hostname as the file name. This is not a great user experience. Plus, some browsers and clients may not check for the header at all.

To resolve this issue, we could have an option to choose if the user wants to include the file name in the path.

uintdev commented 3 years ago

Implemented in v1.1.0.