aspose file tools*
The moose likes Struts and the fly likes StreamResult changes file name during download on Mobile phone Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "StreamResult changes file name during download on Mobile phone" Watch "StreamResult changes file name during download on Mobile phone" New topic
Author

StreamResult changes file name during download on Mobile phone

Kash reily
Greenhorn

Joined: Nov 16, 2009
Posts: 1
Hi,

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[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"?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StreamResult changes file name during download on Mobile phone
 
Similar Threads
download content is outputting to my browser not creating a download file
struts2 file download from database
Delete file when the file downloaded.
downloading a file ok; also want to navigate to another page in the same action not sure how to
Dowloading a file from a a struts 2 web application