Hi all,
I have a FWH app running into a W7 virtual machine.
I would like to add a button to download a file via html from a remote server.
Is there a function to do this ? Thank you in advance.
FUNCTION GETURLTOFILE( cUrl, cFile, lAuth )
LOCAL lOk := .F.
LOCAL oCli
DEFAULT lAuth := .F.
TRY
oCli = TIPClientHttp():New( cUrl )
IF lAuth THEN oCli:UseBasicAuth()
IF EMPTY( oCli ); BREAK; ENDIF
oCli:nConnTimeout = -1
IF !oCli:Open(); BREAK; ENDIF
DEFAULT cFile := oCli:oUrl:cFile
IF !oCli:ReadToFile( cFile ); BREAK; ENDIF
lOk = !EMPTY( oCli:cReply ) .AND. "OK" $ UPPER( oCli:cReply )
IF !lOk; FERASE( cFile ); ENDIF
CATCH
END
IF !EMPTY( oCli ); oCli:Close(); ENDIF
RETURN lOk
Marco Turco wrote:I mean a remote public directory.
A customer has a mac server with static ip and I would like to provide the feature to select a file there from my FWH app (hosted on another server)
oInternet := tInternet():New()
oFtp := tFtp():New(cIp,oInternet,cFtpUserName,cFtpPassword)
aFiles:=oFtp:Directory(cFolderName+"\"*.* )
Marco Turco wrote:I would like to add a button to download a file via html from a remote server.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 117 guests