Download Files

Raytracer

Member
Licensed User
Hello Erel,
Hello to everyone,
Doing this routine for the download:

Sub DownloadFile (LocalFile)
Response.New1
Request.New1(URL)
Request.TimeOut = 30000
Response.Value = Request.GetResponse
Reader.New1(Response.GetStream,true)
FileOpen(c1,LocalFile,cRandom)
Writer.New1(c1,false)
count = Reader.ReadBytes(buffer(),4096)
Do While count > 0
Writer.WriteBytes2(buffer(),0,count)
count = Reader.ReadBytes(buffer(),4096)
Loop
FileClose(c1)
Response.Close
End Sub


In the case in which the URL is momentarily unreachable, the running of the programme is interrupted and an error message appears. Is it possible instead that a string could be generated ( to be used later in an eventual downloads report) without the programme being interrupted?
Thankyou in advance for your replies
 
Top