Hello,
as for the "Save as Dialog", you should do something like this:
Disposition attachment = new Disposition(Disposition.TYPE_ATTACHMENT);
attachment.setFilename("the file name here");
representation.setDisposition(attachment);
return representation;
This will set the proper HTTP headers so the browser will popup the
"save as" dialog when receiving representation.
On Sat, Oct 9, 2010 at 8:05 AM, Jerome Louvel <[email protected]> wrote:
> Hi Nirav,
>
> There is an equivalent property in the Restlet API, see this page for a
> complete mapping table:
> http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/324-restlet/130-restlet.html
>
> Best regards,
> Jerome
> --
> Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
> Noelios Technologies ~ http://www.noelios.com
>
>
>
> -----Message d'origine-----
> De : [email protected] [mailto:[email protected]]
> Envoyé : vendredi 8 octobre 2010 16:15
> À : [email protected]
> Objet : Content-Disposition
>
> Hello All !
>
> I have a web service which sends back PDF/CSV files to the browser.
> But these get downloaded through the browser with a default name and no
> extension!
>
> How do I get the browser to display a 'save as' dialog box and also specify
> the type of file am sending through (pdf/csv) ?
>
> Cheers!
> Nirav
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2669320
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2669583
>
--
Fabián Mandelbaum
IS Engineer
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2669592