All these result in URLUtil.guessFileName returning "media.mp3".
The first download works OK, but subsequent episodes try to resume, because there's already a file called media.mp3. This often results in 404 and a confusing "FileNotFound" exception on the client, since the HTTP range is invalid.
It would be better to use the response's Content-Disposition header's filename, but you can't then set the Range and resume downloads since the request has already been sent.
Maybe download with a temporary, but predictable, filename, then rename on completion?
If you subscribe to a podcast where the URL has the same "file name" every time, then using the "Play attached media file" option doesn't work.
For example, on this feed https://feeds.feedburner.com/RichardHerringLSTPodcast you have
All these result in URLUtil.guessFileName returning "media.mp3".
The first download works OK, but subsequent episodes try to resume, because there's already a file called media.mp3. This often results in 404 and a confusing "FileNotFound" exception on the client, since the HTTP range is invalid.
It would be better to use the response's Content-Disposition header's filename, but you can't then set the Range and resume downloads since the request has already been sent.
Maybe download with a temporary, but predictable, filename, then rename on completion?