Get file from www or ftp
Moderator: Rathinagiri
Get file from www or ftp
I wanna ask , if somebody know how to retrieve file from internet (maybe via www, so login and password is not required)
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Get file from www or ftp
Yes, if we know the exact address of the file/directory.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Get file from www or ftp
Of course, I know concrete adress and filename to retrieve.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Get file from www or ftp
Then you can get the file using a download manager like flashget or if you use firefox there are large number of extensions for downloading by giving the url.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Get file from www or ftp
But....
I wanne build something like autoupdate - my program will test if there is new version on internet and - if newer exists - downloads it and run installation.
So, I need to download new setup file directly from my application - I've tested hyperlink - it works, but in this case user action is required...
I wanne build something like autoupdate - my program will test if there is new version on internet and - if newer exists - downloads it and run installation.
So, I need to download new setup file directly from my application - I've tested hyperlink - it works, but in this case user action is required...
Re: Get file from www or ftp
I'm use wget for windows for update my program's with execute command on minimized window.mol wrote:But....
I wanne build something like autoupdate - my program will test if there is new version on internet and - if newer exists - downloads it and run installation.
So, I need to download new setup file directly from my application - I've tested hyperlink - it works, but in this case user action is required...
1.- with my update program execute the wget on minimized window and i get a file in txt
2.- I read the file txt and check the version on internet
3.- If the version is new then with wget download the new version on temp folder
4.- when the file is downloaded then close the main program and replace the new program.
5.- Listo .....
Regards
Juan Rendon
P.D. My english is bad, i need more practice. jejejeje
Re: Get file from www or ftp
I want to renew this topic.Thanks for your suggestion. I'll try to implement it tomorrow.
Marek
I think installing wget is not the best way...
It works, but - on each computer running my application I need to install wget - it's hard to realize.
Maybe another idea?
I watched for samples linked with MINIGUI Extended - FTPClient - but I don't know how to use it ("ftpclient" doesn't want to compile with Minigui Ext.)
Regards, Marek
Re: Get file from www or ftp
Success!!!
Two days of searching ant testing and I've compiled from everything I found, small function that is really BIG! I wanna share it with us, maybe it will be useful!
I wanna put working example with this function.
Two days of searching ant testing and I've compiled from everything I found, small function that is really BIG! I wanna share it with us, maybe it will be useful!
I wanna put working example with this function.
Code: Select all
PROCEDURE DownloadFromWWW
param cURL, cLocalFileName
LOCAL oCon, oUrl, i
cLocalFileName := alltrim(cLocalFileName)
oUrl := tURL():New( cUrl )
IF Empty( oUrl )
MsgBox("Invalid url " + cUrl)
return
ENDIF
IF oUrl:cProto != "http"
MsgBox('This is a header test for http. Use an http address.')
return
END
oCon := TipClientHttp():New( oUrl )
oCon:nConnTimeout := 20000
MsgBox("Connecting with "+ oUrl:cServer)
IF oCon:Open( cUrl )
MsgBox("Connection eshtablished." +chr(10)+"Press OK to retrieve" + oUrl:cPath +oUrl:cFile)
oCon:WriteAll(cLocalFileName)
MsgBox("Downloaded...")
oCon:Close()
ELSE
MsgBox("Can't connect with "+ oUrl:cServer)
IF oCon:SocketCon == NIL
MsgBox("Connection not initiated")
ELSEIF hb_InetErrorCode( oCon:SocketCon ) == 0
MsgBox("Server sayed: "+ oCon:cReply)
ELSE
MsgBox("Error in connection: " + hb_InetErrorDesc( oCon:SocketCon ))
ENDIF
END
RETURN
- Attachments
-
- download.zip
- (2.26 KiB) Downloaded 429 times
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Get file from www or ftp
Thanks a lot for sharing.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.