Re: Return a File
doug andrews <[email protected]> Wed, 20 Mar 2013 09:32:37 -0400
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
This may work for you:
response.setHeader("inline;filename=3D\"" + filename + =
"\"","content-disposition");
On May 29, 2012, at 5:38 PM, Chad Pilkington wrote:
> Back in the day we had trouble with downloading a file from a =
WebObjects page and getting the file name to show up correctly (Mostly =
IE). However using the below logic the issue was resolved:
>=20
> public void appendToResponse(WOResponse response, WOContext =
context) {
> super.appendToResponse(response,context);
> response.disableClientCaching();
> response.removeHeadersForKey("Cache-Control");
> response.removeHeadersForKey("pragma");
> response.setHeader("application/octet-stream","content-type");
> response.setHeader("inline; attachment; filename=3D\"" + filename =
+ "\"","content-disposition");
> response.setHeader(Integer.toString(data.length()), =
"content-length");
> response.setContent(data);
>=20
> }
>=20
> Now we have discovered a similar problem when trying to download a =
File from WOComponent with Chrome (I have only tested on Mac not PC =
version). Does anyone have some settings that work for Chrome?
>=20
>=20
>=20
> <CalculatedDesignSmaller.png>
>=20
>=20
> Chad Pilkington
> [email protected]
> Office: 519-624-5974 # 9094
> Direct: 226-533-9094
> 55 Fleming Dr, Unit 6
> Cambridge, ON N1T2A9
>=20
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev