Re: File download
Re: File download
- Subject: Re: File download
- From: Chuck Hill <email@hidden>
- Date: Wed, 7 Apr 2004 08:25:25 -0700
Search for 'download' on www.wodev.com
On Apr 6, 2004, at 7:37 PM, email@hidden wrote:
Hi,
What is the correct way to set the headers in a WOResponse so that the
browser saves the received content to a file on the client machine.
Internet Explorer and Firefox work okay. They create a file on my
desktop called "File.csv". However, Safari still displays the
content in the browser as plain text instead of saving it to a file.
Am I doing something wrong? What am I missing. Here's the code
snippet that sends a string of comma-separated-values to the browser:
public void appendToResponse(WOResponse aResponse, WOContext
aContext) {
aResponse.appendContentString(string);
aResponse.setHeader("text/comma-separated-values",
"Content-Type");
aResponse.setHeader(String.valueOf(string.length()),
"Content-Length");
aResponse.setHeader("attachment; filename=File.csv",
"Content-Disposition");
aResponse.setHeader("File.csv", "filename");
}
Thanks in advance,
Ricardo Parada
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.