Adrian Mardare wrote:

> Hi...
> In my embedded browser, I can load a page by using WebNavigation->LoadURI() call.
> The default action is to display the document. We want, if possible, to add a 
>feature to be able to download the url instead of displaying it.
> That means we provide a file to be downloaded into and the url is something like: 
>"http://mysite.com/data.dat".
>
> Is this possible ?( and we want to skip that nsUnknownTypeContentHandler() stuff - 
>we already *know* that we want to just download the file ).
>
> Adrian

You can save any URI or document with the nsIWebBrowserPersist interface

#include "nsIWebBrowserPersist.h"
nsCOMPtr<nsIWebBrowserPersist> persist = do_QueryInterface(mWebBrowser);
persist->SaveURI(uri, nsnull /* postdata stream */, "d:\\data\\somefile");

Adam


Reply via email to