• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File download
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >File download (From: email@hidden)

  • Prev by Date: <a href> contents of link showing
  • Next by Date: Re: compile WebObjects Driver for Linux
  • Previous by thread: Re: File download
  • Next by thread: XHTML & WO
  • Index(es):
    • Date
    • Thread