Download Application Octet Stream Attachments
- Youtube Application Octet Stream
- Application/octet-stream Virus
- C# Application Octet Stream
- Application Octet Stream Example
I can download the audio file and it works correctly. What I want to know is how to, if possible, get the name of the file as it is downloaded instead of giving it my own name. Also, is it possible to get the file without having to read from the stream (maybe some library that does it for you)? I kind of want to hide the dirty stuff. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site. Content type 'application/octet-stream' will always cause Firefox to show the 'open with' download dialog. To avoid this download you would have to configure the server to send another content type and possibly change the file extension of the file.
I've written a download Servlet to return a file based on a messageID parameter. Below is the doGet method.
I then wrote some code to retrieve the file.
Now this code works fine. I can download the audio file and it works correctly. What I want to know is how to, if possible, get the name of the file as it is downloaded instead of giving it my own name. Also, is it possible to get the file without having to read from the stream (maybe some library that does it for you)? I kind of want to hide the dirty stuff.
Thanks
Sotirios DelimanolisSotirios DelimanolisYoutube Application Octet Stream
2 Answers
With attachment, the file will be served with the provided name properly. When inline, browsers seem to ignore filename, and usually give the servletname part of the URL as default name when saving the inline contents.
You could try mapping that URL to an appropriate filename, if that is suitable.
Here's a SO related question: Securly download file inside browser with correct filename
You may also find this link useful: Filename attribute for Inline Content-Disposition Meaningless?
I think you cannot download file without streaming. For I/O you must use stream.
Application/octet-stream Virus
Muhammad Imran TariqMuhammad Imran TariqC# Application Octet Stream
For setting the download file name do the following on response object in Servlet code
EDIT:I see you are already doing it. Just try removing the slashes you have added.
SantoshSantosh