On wo, 2012-04-04 at 01:53 +0200, Willy Raets wrote: > Oh..and you need components: > - gb.net > - gb.net.curl > to make it work... > > Good luck, > > Willy > > On wo, 2012-04-04 at 01:49 +0200, Willy Raets wrote: > > On wo, 2012-04-04 at 00:44 +0200, Willy Raets wrote: > > > Try this: > > > > > > Dim sSourcePath, sCopyPath As String > > > sSourcePath = "http://mydomain/test"
Looking at your original post again the file is not located at http://mydomain/test but at http://www.mydomain.com/test So sSourcePath should be: sSourcePath = "http://www.mydomain.com/test" > > > sCopyPath = User.Home & "/Test" > > > If Not(Exist(sCopyPath) Then > > > MKDIR sCopyPath > > > Endif > > > sCopyPath = sCopyPath & "/test" > > > If Exist(sCopyPath) Then > > > KILL sCopyPath > > > Endif Instead of: > > > DownloadFile(sSourcePath) You could do: DownloadFile (sSourcePath, SCopyPath) > > > > Forgot one line of code that needs to go here: > > > > PUBLIC hGetFileClient AS NEW HttpClient AS "hGetFileClient" > > You then need to change this > > > PUBLIC SUB DownloadFile(sURL AS String) to this: PUBLIC SUB DownloadFile(sUrl As String, sLocPath As String) > > > > > > hGetFileClient.URL = sURL > > > hGetFileClient.TimeOut = 5 > > > hGetFileClient.Async = TRUE And change this > > > hGetFileClient.Get(User.Home & "/Test/test") to this: hGetFileClient.Get(sLocPath) > > > > > > END > > > > > > PUBLIC SUB hGetFileClient_Error() > > > > > > hGetFileClient.Stop() > > > > > > END > > > > > > PUBLIC SUB hGetFileClient_Finished() > > > > > > hGetFileClient.Stop() > > > > > > END > > > > > > > > > > > > On ma, 2012-03-26 at 14:25 -0700, abbat wrote: > > > > I have a file on: > > > > www.mydomain.com/test > > > > > > > > I tried : > > > > > > > > > > > > sSourcePath = "http://mydomain" > > > > sCopyPath = User.Home & "/Test/" > > > > Copy sSourcePath & "test" To sCopyPath & "test" > > > > > > > > but "File or Directory does not exist" > > > > > > > > How to download a file? > > > > Thanks Hope you get the idea :-) ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user