StreamResult changes file name during download on Mobile phone
posted 6 years ago
I'm using Struts2 StreamResult to download a file to mobile phones as follows:
I set all the required parameters in my Action class. The content-disposition is set as follows:
If I assign binName to a string such as "ABC.1.0.0.cab", the downloaded file name displays correctly when downloaded to a desktop.
But on a mobile phone (Windows Mobile to be specific), the name is displayed as "ABC.1.0.0.cab. (There is no existing file on the device which has this filename). If I redirect to a url which points to the file to be downloaded (ABC.1.0.0.cab), the file downloaded shows the correct name on download.
Any idea on why the downloaded file name changes if I use result type="stream"?