Previously, Adam Lock wrote in netscape.public.mozilla.embedding:
> 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");
Thanks,
I will use SaveURI().
At the moment is crashing though, in netwerk/protocol/http/src/nsHTTPRequest.cpp
It seems the problem is that mURI is null ( mURI = do_QueryInterface(i_URL) ), although
i_URL is a valid pointer.
Adrian
> Adam
>
>