Board index » delphi » IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't

IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't

I have an application that is automating retrieval of info via web pages.  I
have a site where I download images, and I need to save these TIFF images.
After navigating to the proper URL and getting the document image (shown in
the browser control) and using this:

var
   other, path: OLEVariant;
begin
   path := 'c:myimage.tiff';
   other := null;
   WebBrowser.ExecWB(OLECMDID_SAVEAS, OLECMDEXECOPT_DONTPROMPTUSER, path,
other);
end;

This works fine except the dialog that prompts for the save information
always comes up.  The second parameter:

OLECMDEXECOPT_DONTPROMPTUSER

is supposed to prevent this according to Microsoft.  I need this to work
"silently," but I cannot seem to find a way to get this to work as
documented.

Any advice?

Thank you.

-Randy

 

Re:IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't


In article <3c64222a$1_2@dnews>, zip...@sprynet.com says...
Quote
> I have an application that is automating retrieval of info via web pages.  I
> have a site where I download images, and I need to save these TIFF images.
> After navigating to the proper URL and getting the document image (shown in
> the browser control) and using this:

Try this instead:

URLDownloadToFile(NULL,LinkName,fName,0,NULL); {found in urlmon.pas}

Re:IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't


HHmmm.  I see that routine in urlmon.pas, but I have no idea what this is
for (or what urlmon.pas) describes.  It doesn't seem to have anything to do
with TWebBrowser unless I'm really missing something (could be).

Any ideas how to point me in the right direction?

-Randy

Quote
"Eddie Shipman" <eship...@austindot.rrdot.com> wrote in message

news:MPG.16d1e5ffc096bcf7989788@forums.borland.com...
Quote
> In article <3c64222a$1_2@dnews>, zip...@sprynet.com says...
> > I have an application that is automating retrieval of info via web
pages.  I
> > have a site where I download images, and I need to save these TIFF
images.
> > After navigating to the proper URL and getting the document image (shown
in
> > the browser control) and using this:

> Try this instead:

> URLDownloadToFile(NULL,LinkName,fName,0,NULL); {found in urlmon.pas}

Re:IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't


In article <3c684c08$1_1@dnews>, zip...@sprynet.com says...
Quote
> HHmmm.  I see that routine in urlmon.pas, but I have no idea what this is
> for (or what urlmon.pas) describes.  It doesn't seem to have anything to do
> with TWebBrowser unless I'm really missing something (could be).

> Any ideas how to point me in the right direction?

Actually it has nothing to do with TWebBrowser. You can take the
current URL from TWebBrowser and passit to the function and
it will DL the entire site to the filename specified.

I have never had a problem with:

procedure TForm1.FullSaveAsClick(Sender: TObject);
var
 Vin,Vout : OleVariant;
begin
 vin:='';
 vout:='';
 WebBrowser.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT,
                   vin, vout);
end;

so I don't know why you would be having problems.

Re:IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't


I tried the code as you provided with the exact same results: the save
dialog is displayed.  I am running Windows 2000 and v5.5 of IE.  I wonder if
that has anything to do with anything.

I'll see if I can monkey around with the urlmon routine and see what it
does.  I guess I misunderstood before--I assumed the urlmon.pas described
the interface for a component.  I am totally unfamiliar with urlmon, but I
guess that will change shortly.

-Randy

Quote
"Eddie Shipman" <eship...@austindot.rrdot.com> wrote in message

news:MPG.16d20d7a52037f7e989789@forums.borland.com...
Quote
> In article <3c684c08$1_1@dnews>, zip...@sprynet.com says...
> > HHmmm.  I see that routine in urlmon.pas, but I have no idea what this
is
> > for (or what urlmon.pas) describes.  It doesn't seem to have anything to
do
> > with TWebBrowser unless I'm really missing something (could be).

> > Any ideas how to point me in the right direction?

> Actually it has nothing to do with TWebBrowser. You can take the
> current URL from TWebBrowser and passit to the function and
> it will DL the entire site to the filename specified.

> I have never had a problem with:

> procedure TForm1.FullSaveAsClick(Sender: TObject);
> var
>  Vin,Vout : OleVariant;
> begin
>  vin:='';
>  vout:='';
>  WebBrowser.ExecWB(OLECMDID_SAVEAS,OLECMDEXECOPT_DODEFAULT,
>                    vin, vout);
> end;

> so I don't know why you would be having problems.

Re:IE5 / TWebBrowser SaveAs Always Shows File Dialog but Shouldn't


<<Randy Owens:
I tried the code as you provided with the exact same results: the save
dialog is displayed.  

Quote

There are security limitations on saving without prompts in IE:
http://msdn.microsoft.com/library/en-us/dn_voices_webmen/html/webteam...
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;q244757&

--
Deborah Pate (TeamB) http://delphi-jedi.org

  TeamB don't see posts sent via Google or ISPs
  Use the real Borland server: newsgroups.borland.com
  http://www.borland.com/newsgroups/genl_faqs.html

Other Threads