Chad Pilkington
2012-05-29 21:38:11 UTC
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:
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=\"" + filename
+ "\"","content-disposition");
response.setHeader(Integer.toString(data.length()), "content-
length");
response.setContent(data);
}
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?
Chad Pilkington
***@calculateddesign.com
Office: 519-624-5974 # 9094
Direct: 226-533-9094
55 Fleming Dr, Unit 6
Cambridge, ON N1T2A9
WebObjects page and getting the file name to show up correctly (Mostly
IE). However using the below logic the issue was resolved:
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=\"" + filename
+ "\"","content-disposition");
response.setHeader(Integer.toString(data.length()), "content-
length");
response.setContent(data);
}
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?
Chad Pilkington
***@calculateddesign.com
Office: 519-624-5974 # 9094
Direct: 226-533-9094
55 Fleming Dr, Unit 6
Cambridge, ON N1T2A9