Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Download Files

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2008, 01:47 PM
Junior Member
 
Join Date: Mar 2008
Posts: 46
Default Download Files

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
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 01:54 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You can use ErrorLabel to catch the error and do what ever you need.
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 01:57 PM
Junior Member
 
Join Date: Mar 2008
Posts: 46
Default

Many thanks for your reply, Erel.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with download file Byak@ Questions (Windows Mobile) 2 07-14-2008 07:14 PM
Why can't I Download all the examples? Jonathon Questions (Windows Mobile) 4 06-24-2008 05:18 PM
Download files Raytracer Italian Forum 4 04-13-2008 11:01 PM
Can I upload and download files from device to PC superbabicka Questions (Windows Mobile) 2 03-31-2008 03:47 PM
Progress bar on FTP download willisgt Questions (Windows Mobile) 16 01-28-2008 05:22 PM


All times are GMT. The time now is 12:32 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0