• 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: Streaming File Downloads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Streaming File Downloads


  • Subject: Re: Streaming File Downloads
  • From: Ismael Perdido <email@hidden>
  • Date: Thu, 14 Oct 2004 06:43:53 +0200 (CEST)

Greg:

Thanks for this tip, now I have to first deal with the
file I have - Am I crazy to think I can pass this from
the DB to the client in memory? (files may be several
MB)  Then perhaps a reccomendation on the fastest
scheme for handling the files in this way?

Many thanks,

Ismael

 --- Greg Hulands <email@hidden>
escribió:

> This is what I use in a separate component called
> document downloader:
>
> public void appendToResponse(WOResponse response,
> WOContext context) {
>          super.appendToResponse(response, context);
> 		URL file = null;
> 		NSData fileContents = null;
>
> 		try {
> 			file = new URL("file", null, doc.path() +
> doc.file());
> 			fileContents = new NSData(file);
>
> 			response.setContentEncoding("UTF8");
> 			response.setHeader(doc.mimeType(),
> "content-type");
> 			response.setHeader("filename=" +
> doc.filename(),"Content-Disposition");
> 			response.setContent(fileContents);
> 			response.setStatus(WOMessage.HTTP_STATUS_OK);
> 		} catch (Exception e) {
> 			System.out.println("Error Downloading file: " +
> e);
> 		}
> 	}
>
> HTH,
> Greg
>
> On 11/10/2004, at 9:44 AM, Ismael Perdido wrote:
>
> > Hi All,
> >
> > I would like to serve the client a file to
> download
> > using a DirectAction.
> >




______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es
 _______________________________________________
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: 
 >Re: Streaming File Downloads (From: Greg Hulands <email@hidden>)

  • Prev by Date: Re: How to stop WOImage logging
  • Next by Date: Re: Collaborative document management
  • Previous by thread: Re: Streaming File Downloads
  • Next by thread: SOLVED [still newbie] How to redisplay correctly a
  • Index(es):
    • Date
    • Thread