now I made If val(cWinVersion())=7 but I not know if it's correct
this because I have problem to download a file from a website with Windows Seven
with GETURLTOFILE(cUrl,cZipFile)
- Code: Select all Expand view
STATIC FUNCTION GETURLTOFILE( cUrl, cFile, cUsr, cPsw )
LOCAL lOk := .F.
LOCAL oHtp, oStr, ex
DEFAULT cFile := CFILENAME( STRTRAN( cUrl, "/", "\" ) )
//TRY
oHtp = CREATEOBJECT( "Msxml2.XMLHTTP.6.0" )
oHtp:Open( "POST", cUrl, .F., cUsr, cPsw )
oHtp:Send()
IF oHtp:Status != 200 THEN BREAK
MemoWrit(cFile,oHtp:ResponseBody)
//oStr = CREATEOBJECT( "ADODB.Stream" )
//oStr:Open()
//oStr:Type = 1
//oStr:Write( oHtp:ResponseBody )
//oStr:SaveToFile( cFile, 2 )
//oStr:Close()
lOk = .T.
//CATCH ex
// ? ex:message
//END
RETURN lOk
while on win10 I can use GETURLTOFILE(cUrl,cZipFile)
on widows seven I must use
- Code: Select all Expand view
- FUNCTION Download( cUrl )
cUrl := IF( "@" $ cUrl, "mailto:" + cUrl, cUrl )
// ? cUrl
IF Empty( cUrl )
MsgInfo( "Introdurre URL Correta", "Attenzione" )
ELSE
CURSORWAIT()
IF IsWinNT() .OR. isWin2000() // XP/2000/NT
WinExec( "rundll32.exe url.dll, FileProtocolHandler " + cUrl, 0 )
ELSE
WinExec( "Start " + cUrl, 0 )
ENDIF
CURSORARROW()
ENDIF
RETURN NIL
only I cannot copy the file into a my folder but it save the file on folder download of window
is there a solution ?