Re: Streaming File Downloads
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