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

Re: FileDownload


  • Subject: Re: FileDownload
  • From: email@hidden
  • Date: Mon, 17 Nov 2003 12:45:29 CDT
  • Priority: 3 (Normal)

[demime could not interpret encoding binary - treating as plain text]
You may also be interested in the information here:

http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/2/wa/Main?wikiPage=ReturningFileToBrowser

If you have more information, please add it there!  It's a wiki page that
can be edited by anyone.

--Jonathan

On Mon, 17 Nov 2003 10:42:24 -0500 Serge Froment wrote:

> Hi Kranthi,
>
> Here is the code I use in a direct action to trigger file downloading.
> This works with Safari and IE on both Mac and Windows machines. The
> file is downloaded with the file name I pass in the Content-Disposition
> header.
>
> 	public WOResponse downloadAction()
> 	{
> 		String desktopRequest = (String) request().formValueForKey("id");
> 		Desktop desktop = Application.desktopWithID(new
> Integer(desktopRequest));
> 		desktop.photo().incrementDownloadCount();
> 		WOResponse response = new WOResponse();
> 		response.setHeader("data/binary", "Content-Type");
> 		response.setHeader("attachment;filename=" + desktop.filename(),
> "Content-Disposition");
> 		response.setContent(desktop.desktopImage().image());
>          return response;
> 	}
>
> Le 16 nov. 2003, ` 10:01, Kranthi Sagar Borra a icrit :
>
> > I used "application/octet-stream" as the MIME type.But this downloads
> > the file with a different name every time like 12345.jpg instead of
> > hello.jpg.Can somebody please tell me how I can resolve this
> > issue..Thank you.
> >
>
> Serge Froment
> http://www.serge-froment.com
> _______________________________________________
> 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.

  • Prev by Date: Re: "Cannot obtain globalId for an object which..."
  • Next by Date: Re: Database or Realtime
  • Previous by thread: Re: FileDownload
  • Next by thread: WebServicesAssistant and 5.2.2
  • Index(es):
    • Date
    • Thread