• 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: Greg <email@hidden>
  • Date: Fri, 1 Jul 2005 13:55:04 +1000

public void appendToResponse(WOResponse response, WOContext context) {
        super.appendToResponse(response, context);
        URL file = null;
        NSData fileContents = null;

try {
file = new URL("file", null, img.path() +"/"+ img.print());
fileContents = new NSData(file);
response.setContentEncoding("UTF8");
response.setHeader("image/jpeg", "content-type");
response.setHeader("attachment; filename=" + img.filename (),"Content-Disposition");
response.setContent(fileContents);
response.setStatus(WOMessage.HTTP_STATUS_OK);
} catch (Exception e) {
System.out.println("Error Downloading file: " + e);
}
}


On 01/07/2005, at 1:41 PM, Valerio Luccio wrote:

Hi all,
this has been driving me nuts. I'm looking for the equivalent of WOFileupload to do a download. In other words, I want to duplicate the behavior of the "Save as ..." where you can chose a directory and specify a file name.


--
Valerio Luccio                  (212) 998-8736
Center for Brain Imaging        4 Washington Place, Room 156
New York University             New York, NY 10003

       "In an open world, who needs windows or gates?"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40framedphotographics.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Nasty WO Builder 5.3 bug deletes components (From: Brendan Duddridge <email@hidden>)
 >File download (From: Valerio Luccio <email@hidden>)

  • Prev by Date: File download
  • Next by Date: Re: Design Question...
  • Previous by thread: File download
  • Next by thread: [WO 5.3] HTML 4.01
  • Index(es):
    • Date
    • Thread