Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need the name of the file downloaded
Message
From
13/03/2017 15:48:36
 
 
To
13/03/2017 12:36:31
General information
Forum:
Visual FoxPro
Category:
Web Services
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01648981
Message ID:
01648993
Views:
39
*!*	-urlDownloadtofile api can download any web file but you must give it a name and extension in disc yourself (fullpath.)
*!*https://msdn.microsoft.com/en-us/library/ms775123(v=vs.85).aspx
*!*by luck if the url have an extension you must choose the same extension to make the downloaded file available.

*- the code below at least can give you the type of the file downloaded (mime or content-type)

Local loRequest,lcUrl

m.lcUrl="http://img.over-blog-kiwi.com/1/43/54/07/20160313/ob_1f4998_sam-2260-resized.JPG"
m.loRequest = Createobject('MsXml2.XmlHttp')
m.loRequest.Open("HEAD",lcUrl,.F.)
m.loRequest.Send()
Messagebox( m.lcUrl+Chr(13)+"content-type="+m.loRequest.getResponseHeader("content-type"))
Messagebox(m.lcUrl+Chr(13)+ "AllResponseHeaders:"+Chr(13)+m.loRequest.getAllResponseHeaders)
m.loRequest=Null
Previous
Reply
Map
View

Click here to load this message in the networking platform