Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Webbrowser - how to save image (jpg)
Message
 
To
18/06/2013 07:42:40
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01576604
Message ID:
01576648
Views:
49
>Hi !
>After a long period...
>
>I'm using webbrowser for quite a while, but this is the first time I need to save an image (jpg) to disk.
>I have this image in the webbrowser screen and I wonder how to programmatically save it to disk.
>
>Looking forward for any help.
>Thanks
>Dany

You probably can adapt this to the webbrowser
Local lcFolderDest,Doc
o = Createobject('internetexplorer.application')
o.Navigate('www.microsoft.com')
lcFolderDest = 'c:\temp\'
Inkey(3)

Doc = o.Document
For Each element In Doc.images
	DownloadPicture( lcFolderDest, element.src)
	DoEvents
Endfor
Procedure DownloadPicture(tcDestDir,src)
	Local loRequest, lcUrl, lcFilename
	lcUrl =src
	lcFilename = tcDestDir+justfname(src)

	loRequest = Createobject('MsXml2.XmlHttp')
	loRequest.Open("GET",lcUrl,.F.)
	loRequest.Send()
	Strtofile(loRequest.ResponseBody,lcFilename)
Endproc
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform