I had problems downloading stuff when IE was the client. After snooping
around google, I added these header lines and things worked but I don't
really understand why.
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "max-age=0");
Jan Froehlich wrote:
> Hey Dave,
> thanks for your hint - I searched for "contype" and guess I found what
> you meant.
>
> What I understood is, that IE sends two extra requests after the "main"
> request to identify the content type from content that has to be
> displayed in a plug-in like Acrobat Reader.
> For csv files its different. Those files are just plain text files with
> "Colon Separated Values" - means that no plugin is neccesary to display.
>
> For me it s nice to know, but unfortunately it doesn't solve my problem.
>
> Regards
> Jan
>
>
> Von: Dave Newton [mailto:newton.dave@yahoo.com]
> Gesendet: Montag, 2. Juni 2008 22:55
> An: Struts Users Mailing List
> Betreff: Re: Problem generating a csv file for download
>
> Isn't there something about IE that makes two calls, one with a
> "contype" user agent request header? I remember seeing something about
> that somewhere relating to PDF documents; I have no idea if it's similar
> for CSV or not, but it's easy enough to check the wire.
>
> Dave
>
>
> --- On Mon, 6/2/08, Jan Froehlich <Jan.Froehlich@infomotion.de> wrote:
>
>> From: Jan Froehlich <Jan.Froehlich@infomotion.de>
>> Subject: Problem generating a csv file for download
>> To: "Struts Users Mailing List" <user@struts.apache.org>
>> Date: Monday, June 2, 2008, 1:28 PM
>> Hi List,
>>
>> I'm developing an webapp generating csv files based on
>> some hibernate
>> queries - so far so good.
>>
>> Action "csvSelect" is used to display a form with
>> a select box and a
>> datetimepicker and to pass 2 parameters to the second
>> action
>> "csvGenerate" which is the one that generates the
>> csv file.
>>
>> <action name="csvSelect"
>> class="de.myfiles.actions.CsvSelect">
>> <result name="success"
>> type="redirectAction">
>> <param
>> name="actionName">csvGenerate</param>
>> </result>
>> <result name="input"
>> type="tiles">tiles.page.select</result>
>> </action>
>>
>> <action name="csvGenerate"
>> class="de.myfiles.actions.CsvGenerate">
>> <result name="success"
>> type="stream"></result>
>> </action>
>> To this point everything is working like a charm.
>> But when I set
>>
>> response.setHeader("Content-Disposition",
>> "attachment; filename=myfile.csv");
>> response.setContentType("text/x-download");
>>
>> The action is called once and building my csv content -
>> after I return
>> SUCCESS it displays the Internet Explorer "Open /
>> Save" dialog and when
>> I click on "open" or "save" the action
>> is called another time - but now
>> I dont have access to the parameters passed from the first
>> action.
>>
>> As I am new to struts2 and I am no native speaker I hope
>> that someone
>> understands what my problem is and gives me a clue!
>>
>> Thanks in advance!
>>
>> Jan Froehlich
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
mark.shifman@yale.edu
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
|