开发者

Download file is null in Firefox when initiating a Stream Result

I am creating a website that generates formatted excel files (.xlsx) for users based on input (using Struts2). My action is defined as follows:

开发者_运维技巧
    <action name="print" class="org.jeshurunsoftware.action.PrintCardsAction" 
        method="print">         
        <result name="download" type="stream">
            <param name="contentDisposition">filename="printCards.xlsx"</param>
            <param name="contentType">application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</param>
            <param name="inputName">inputStream</param>
            <param name="bufferSize">1024</param>
        </result>
    </action>

The excel file is successfully generated and saved in both Google Chrome and IE8. However, in Firefox 3, when the user clicks "Print," an empty download dialog box displays. The user is prompted to open a file with no name (e.g. the download prompt says "You have chosen to open .")

Any thoughts as to why this is broken in Firefox 3 (and how to fix)?

Thanks in advance!


I created a test case that used your exact configuration from above and ran it on Windows 7 (Firefox 3 and IE9 beta) and Mac OS X (Firefox 3, Chrome, Safari, and Opera) and it ran fine across all environments.

Have you had this problem on multiple Firefox installs or just one? Assuming this is isolated to just a single Firefox, you may want to check to see if there is an add-on installed that is changing the behavior, or if a custom handler ha been registered for the mime type.


I downloaded Firefox 4 Beta 8 to see if this is an issue with Firefox 3.6.13. The download worked like a charm, so I'm suspecting that this is a bug with this particular version of firefox.

As to why, I still don't have an answer. Steven your suggestions were very helpful - I disabled all firefox add-ons, and when that didn't work, I cleared all of my personal browser data and re-installed firefox 3.6.13 from scratch. I wasn't able to find any known bugs with this particular version of firefox, though I suspect this is the case. Any other suggestions would be greatly appreciated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜