Page 2 of 3
Re: HMG FTP Sample ?
Posted: Sun Jun 21, 2020 2:03 pm
by danielmaximiliano
Jimmy: your code is wrongly building the url.

- 2020-06-21 10_53_33-Window.png (44.97 KiB) Viewed 2644 times
Code: Select all
cUrl := cProtocol + ALLTRIM( cUser ) + ":" + ALLTRIM( cPassWord ) + "@" + ALLTRIM( cServer )
msgbox (cUrl, "Site") /* bad URL */
oUrl := tURL() :New( cUrl )
IF EMPTY( oUrl )
RETURN nil
Re: HMG FTP Sample ?
Posted: Sun Jun 21, 2020 6:22 pm
by AUGE_OHR
hi,
Source is from MiniGUI Extended Version. i just try to run it with HMG "pure"
as i know Syntax is
Code: Select all
"ftp://" + UserName + ":" + Password + "@" + ServerName
you can try the String with FF, IE or EDGE to connect to FTP
but the Problem is not to connect to FTP-Site ... it is download of "some" files which don´t work
Re: HMG FTP Sample ?
Posted: Sun Jun 21, 2020 10:38 pm
by AUGE_OHR
hi,
now i saw in Logfile
>> 11-23-17 10:02PM 196572273 Devcon Party_2.mkv
11-23-17 09:09PM 121868933 DevConParty_1.mkv
11-23-17 09:49PM 2466639002 Express++ Roger Donnay.mkv
04-24-18 02:03PM 1609613369 OOP Hoffmann deutsch.mkv
04-30-18 05:02PM 1160915531 OOP in der Praxis Andreas Herdt.mkv
04-30-18 01:27PM 1514723673 OOP MH english.mkv
04-30-18 01:27PM 1381491719 Steffen Piersig Advanced SQL deutsch (Anfang fehlt).mkv
so i did "extract" Name wrong ...
Re: HMG FTP Sample ?
Posted: Sun Jun 21, 2020 10:50 pm
by danielmaximiliano
Jimmy :
how to compile your minigui example
I am not a HMGext user
I try to use the Batch compile.bat and it gives me a compilation error
Re: HMG FTP Sample ?
Posted: Sun Jun 21, 2020 11:59 pm
by AUGE_OHR
hi,
i have change
to
Code: Select all
#ELSE
ftpMain.Grid_2.DisableUpdate
ftpMain.Grid_2.DeleteAllItems
acDir := oClient:list() // on serverside
avalues := AtInside( CRLF, acDir ) // make Array from String
iMax := LEN( avalues )
FOR x := 1 TO iMax
cLine := avalues[ x ]
cDate := SUBSTR(cLine,1,8)
cTime := SUBSTR(cLine,11,7)
cSize := SUBSTR(cLine,18,22)
cFile := SUBSTR(cLine,40)
IF !EMPTY(cFile)
nDirImg := IF( 'DIR' $ cSize , 0, 1 )
ftpMain.Grid_2.AddItem( { nDirImg, ;
cFile, ;
LTRIM(cSize), ;
cDate, ;
cTime, ;
"" } )
ENDIF
NEXT
#ENDIF
ftpMain.Grid_2.EnableUpdate
RETURN nil
now i can download all files

Re: HMG FTP Sample ?
Posted: Mon Jun 22, 2020 12:33 am
by AUGE_OHR
hi,
danielmaximiliano wrote: ↑Sun Jun 21, 2020 2:03 pm
Jimmy: your code is wrongly building the url.
as i say : it is not "my" Code ... i made it from MinuGUI Extended Version Sample just ready for HMG
Modification "in" Code most use
so i leave Original Code untouched
it was the GRID which display Data "wrong" so i try to find other Way to fill GRID.
i have use o:listFiles() as Serge say but i´m not sure about it any more
now i use o:list() but "miss Attribute" now.
---
you have "@" in User Name but @ is the "delimiter" for Server in String -> wrong URL
i also had a Password with "?" which does not work so some Sign have "special" function in this URL Syntax.
try it in your Browser (FF, IE or EDGE)
Code: Select all
ftp://ftp2019:Aio3t19?@vserver.xbaseentwickler.de
this will lead you to Google or Bing as there is "?" in Password ( not valid any more ... )
i was told it is possible to use "@" or "?" but you can´t send it in URL-String
Code: Select all
cUrl := "ftp://@vserver.xbaseentwickler.de"
oUrl := tURL() :New( cUrl )
oClient := TIpClientFtp():new( oUrl, Sites->Log )
now Browser will ask for User and Password
Re: HMG FTP Sample ?
Posted: Mon Jun 22, 2020 8:51 am
by serge_girard
Ampersand and questionmark in URL are supposed to mark parameters such as:
Code: Select all
https://hmgforum.com/viewtopic.php?f=5&t=6482&start=10
Serge
Re: HMG FTP Sample ?
Posted: Mon Jun 22, 2020 11:31 am
by AUGE_OHR
hi,
danielmaximiliano wrote: ↑Sun Jun 21, 2020 10:50 pm
how to compile your minigui example
I am not a HMGext user
I try to use the Batch compile.bat and it gives me a compilation error
do you mean c:\MiniGUI\SAMPLES\Advanced\FtpClient\Compile.bat

Re: HMG FTP Sample ?
Posted: Mon Jun 22, 2020 11:36 am
by AUGE_OHR
hi,
serge_girard wrote: ↑Mon Jun 22, 2020 8:51 am
Ampersand and questionmark in URL are supposed to mark parameters such as:
hm ... how to validate if User want to type it into TEXTBOX

Re: HMG FTP Sample ?
Posted: Mon Jun 22, 2020 12:44 pm
by edk
AUGE_OHR wrote: ↑Mon Jun 22, 2020 12:33 am
hi,
danielmaximiliano wrote: ↑Sun Jun 21, 2020 2:03 pm
Jimmy: your code is wrongly building the url.
as i say : it is not "my" Code ... i made it from MinuGUI Extended Version Sample just ready for HMG
Modification "in" Code most use
so i leave Original Code untouched
it was the GRID which display Data "wrong" so i try to find other Way to fill GRID.
i have use o:listFiles() as Serge say but i´m not sure about it any more
now i use o:list() but "miss Attribute" now.
---
you have "@" in User Name but @ is the "delimiter" for Server in String -> wrong URL
i also had a Password with "?" which does not work so some Sign have "special" function in this URL Syntax.
try it in your Browser (FF, IE or EDGE)
Code: Select all
ftp://ftp2019:Aio3t19?@vserver.xbaseentwickler.de
this will lead you to Google or Bing as there is "?" in Password ( not valid any more ... )
i was told it is possible to use "@" or "?" but you can´t send it in URL-String
Code: Select all
cUrl := "ftp://@vserver.xbaseentwickler.de"
oUrl := tURL() :New( cUrl )
oClient := TIpClientFtp():new( oUrl, Sites->Log )
now Browser will ask for User and Password
try:
Code: Select all
cSrvFTP := "vserver.xbaseentwickler.de"
cUrl:= "ftp://" + cSrvFTP
oUrl:= tUrl():New( cUrl )
oFTP:= TIPClientFtp():New( oUrl, .F. )
oFTP:nConnTimeout := 20000
oFTP:bUsePasv := .T.
oFTP:oUrl:cServer := cSrvFTP
oFTP:oUrl:cUserID := UserName
oFTP:oUrl:cPassword := Password
for progressbar U can use:
Code: Select all
oFtp:exGauge := { | done, size| any_disp_progressbar_function( INT( ( done / size ) *100 ) ) }