Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internet Explorer - Save Target As

Status
Not open for further replies.

ontsjc

Technical User
May 17, 2000
113
I have a client who needs to pull around 1500 pictures off their ecommerce site that had been hand loaded over the course of many years. I have all the url's to the pics in a dbf suitable for easy scan looping, but I can't seem to find a way to automate the Save Taget As option in IE. Any suggestions? As an alternative, I've tried automatically copying the files out of the Temporary Internet Files folder, but there seem to be some permissions there that I also can't find. Thanks for any help you may be able to provide.
 
Here a function I borrowed by a member of other forum named Tore Bleken:

Code:
FUNCTION GetFileFromURL(lcRemoteFile,lcLocalFile)
	LOCAL lnReturn
	DECLARE INTEGER URLDownloadToFile IN urlmon.dll; 
	    INTEGER pCaller, STRING szURL, STRING szFileName,; 
	    INTEGER dwReserved, INTEGER lpfnCB 

	lnReturn = URLDownloadToFile (0, lcRemoteFile, lcLocalFile, 0, 0) 
RETURN lnReturn=0

So you can use it that way:
Code:
SELECT MyTableWithPicturesURL
SCAN
  lcLocalFile = "c:\pictires\"+JUSTFNAME(URLAddressOfPicture)
  GetFileFromURL(ALLTRIM(URLAddressOfPicture),lcLocalFile)
ENDSCAN

Borislav Borissov
 
Excellent! Thank you very much!
 

Ontsjc,

I see Borislav has given you a good solution.

However, you might like to keep in mind that, in general you can automate most IE functions by means of the ExecWB method. This lets you programmatically execute menu choices in IE. You pass a pair of numbers to indicate the menu and the option within the menu.

In your case, Borislav's solution is better, because you don't have to load the entire web page each time, but ExecWB might be useful in other situations.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks very much for the Tip Mike. I'm just getting in to more IE automation and am starting to feel my way around a bit. If you have any quick references you could suggest. I would appreciate. Thanks for your input.
 


If you have any quick references you could suggest. I would appreciate

I don't. What I little I know, I picked up from various articles and threads over the years. However, there is quite a good article on the MSDN site that will give you a start. Try searching for Reusing the WebBrowser Control

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
ontsjc

This might help

Code:
#DEFINE OLECMDEXECOPT_DODEFAULT 0
#DEFINE OLECMDID_SAVEAS 4
oIe = CREATEOBJECT('internetexplorer.application')
oiE.navigate('about:blank') && What ever page
_screen.Visible = .f.
oIe.ExecWB(OLECMDID_SAVEAS , OLECMDEXECOPT_DODEFAULT)
oIe.visible = .t.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top