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.
Marco Turco
SOFTWARE XP LLP
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 lOkHi Enrico,
not bad, thank you, anyway, the best for my customer would to "browse" the directory and select the file instead to write the full url.
Any ideas about this ?
Marco,
do you mean "browse the remote directories" or the local ones?
EMG
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)
Marco,
I don't know, sorry. ![]()
EMG
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+"\"*.* )Anser,
I don't think Marco wants to use FTP. Marco?
EMG
Marco Turco wrote:
I would like to add a button to download a file via html from a remote server.
I would avoid to use the ftp.
The EMG solution is fine but I would prefer a solution like that you have (for example) on a webmail where to attach a file you press a button and you can select it from your local computer.