You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by ra...@L-3com.com on 2007/10/08 19:45:56 UTC

FW: file download issue

 
Brendan,
 
I saw your post on apache as follows:
 
Our application has a requirement to export certain data as a

comma-delimited file to the user.  To do this, our action class does the

following:



response.setContentType("text/html");

response.setHeader("Content-Disposition", "attachment;filename=3D\"" +

defaultFileName + "\"");

PrintWriter out =3D response.getWriter();

...

out.println(data); // in a loop to output all the rows

...

facesContext.getApplication().getStateManager().saveSerializedView(faces

Context);

facesContext.responseComplete();

return null;



The above works fine in that, when the action is invoked, the user gets

the typical "file download" pop-up (with the options: open, save,

cancel, or more info).  The pop-up gets displayed with following

checkbox checked and disabled: "Always ask before opening this type of

file."



The problem is that, if I press the "open" button, the same dialog

re-appears, but this time, the checkbox is enabled.  Only after I hit

"open" again can I actually see the data.  By contrast, if I hit the

"save" button, I only have to do that once.



Can anyone explain to me why I have to hit the "open" button twice on

the "file download" pop-up, given the code I've listed above?
I am currently working on an application that has the exact same error.  Did
you ever get a fix for this?  IF so, could you please tell me what it is?
Thank-you,
Ray Milburn
Senior Software Engineer
L3 Communications, GSI



-------------------
GO SPURS!!
-------------------
 

Re: FW: file download issue

Posted by classis <ca...@manshusen.de>.
I have this problem too! Is there a fix or workaround for this? Why does this
error not appear in the tobago demo application (Download PDF page)?

Best regards, 
Carsten
-- 
View this message in context: http://www.nabble.com/FW%3A-file-download-issue-tf4594018.html#a13119991
Sent from the My Faces - Dev mailing list archive at Nabble.com.


RE: file download issue

Posted by "Byington, Suzanne" <Su...@henryschein.com>.
I don't remember posting this.  Are you sure I posted it. I do know that
I had a problem with file download. It would state that it could not
find the file. I found that on a linux system, the file download
expected a windows temp dir off root, not the unix tmp dir that existed.

Can you send me a link to this thread, perhaps it will refresh my
memory.

 

Suzanne

________________________________

From: ray.milburn@L-3com.com [mailto:ray.milburn@L-3com.com] 
Sent: Monday, October 08, 2007 11:46 AM
To: 'myfaces-dev@incubator.apache.org'
Subject: FW: file download issue

 

 

Brendan,

 

I saw your post on apache as follows:

 

Our application has a requirement to export certain data as a
comma-delimited file to the user.  To do this, our action class does the
following:
 
response.setContentType("text/html");
response.setHeader("Content-Disposition", "attachment;filename=3D\"" +
defaultFileName + "\"");
PrintWriter out =3D response.getWriter();
...
out.println(data); // in a loop to output all the rows
...
facesContext.getApplication().getStateManager().saveSerializedView(faces
Context);
facesContext.responseComplete();
return null;
 
The above works fine in that, when the action is invoked, the user gets
the typical "file download" pop-up (with the options: open, save,
cancel, or more info).  The pop-up gets displayed with following
checkbox checked and disabled: "Always ask before opening this type of
file."
 
The problem is that, if I press the "open" button, the same dialog
re-appears, but this time, the checkbox is enabled.  Only after I hit
"open" again can I actually see the data.  By contrast, if I hit the
"save" button, I only have to do that once.
 
Can anyone explain to me why I have to hit the "open" button twice on
the "file download" pop-up, given the code I've listed above?
I am currently working on an application that has the exact same error.
Did you ever get a fix for this?  IF so, could you please tell me what
it is?
Thank-you,
Ray Milburn
Senior Software Engineer
L3 Communications, GSI
 

-------------------

GO SPURS!!

-------------------

 

E-mail messages may contain viruses, worms, or other malicious code. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective action against such code. Henry Schein is not liable for any loss or damage arising from this message.

The information in this email is confidential and may be legally privileged. It is intended solely for the addressee(s). Access to this e-mail by anyone else is unauthorized.