| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Mar 27, 2003 9:06 pm Post subject: Pausing/resuming/finding if resume is available with VDSIPP |
|
|
Hi all,
I couldn't fit everything into the subject line but I'm having some trouble
with figuring out how to pause/resume a dowloading file with VDSIPP.DLL
and finding out if resume is supported by the server. Has anyone ever tried
to do this before? I'm not sure exactly how it works. If someone could give
a basic outline of how to do this it would be greatly apprecieated.
Thanks.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Thu Mar 27, 2003 9:20 pm Post subject: |
|
|
I used a resume function with my program Live Update....
I saved the transfered bytes size into a var and changed it if the download was not interupted.
If the download was interupted the next time the program was run it would automatically resume the download from the last saved var....
Nathan
I can give you the source code of Live Update, I was going to make it open source. It's very messy code and complicated as well. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Mar 27, 2003 9:47 pm Post subject: |
|
|
Thanks.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Thu Mar 27, 2003 11:38 pm Post subject: |
|
|
| Rubes_sw wrote: | I used a resume function with my program Live Update....
I saved the transfered bytes size into a var and changed it if the download was not interupted.
If the download was interupted the next time the program was run it would automatically resume the download from the last saved var....
Nathan
I can give you the source code of Live Update, I was going to make it open source. It's very messy code and complicated as well. |
yea i would like to see that code to please...sounds to be neat  _________________ Have a nice day  |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Mar 28, 2003 9:32 am Post subject: |
|
|
OK, Heres the resume code i used in Live Update !
It's quite messy and i am sure it code be improved on, but hopefully it will give you the idea !
Uses vdsipp.dll
| Code: |
REM Check for resume.log, if it is there then display resume dialog
if @file(@path(%0)\resume.log)
DIALOG CREATE,Live Update System - Resume Download,-1,0,390,352,NOMIN
DIALOG ADD,STYLE,STYLE10,,,,WHITE,004080
DIALOG ADD,STYLE,STYLE11,,,B,,RED
DIALOG ADD,STYLE,STYLE12,,,B,,004080
DIALOG ADD,BITMAP,BITMAP11,0,0,390,74,%%about_bmp
DIALOG ADD,TEXT,TEXT32,84,76,,,The last attempt to download an update failed.,,STYLE12
DIALOG ADD,TEXT,TEXT34,104,76,,,Live Update can attempt to resume downloading.,,STYLE12
DIALOG ADD,TEXT,TEXT35,144,76,,,,,STYLE12
dialog add,text,text36,174,76,,,Would you like to Resume Download?,,style11
dialog add,text,text37,194,76,,,,,style11
DIALOG ADD,BUTTON,NO,330,320,64,20,No,,,default
Dialog ADD,BUTTON,YES,330,250,64,20,Yes
DIALOG SHOWMODAL
wait event
%E = @event()
goto Childq_%E
:Childq_YESBUTTON
%%resumeNOW = YES
DIALOG CLOSE
wait event
%E = @event()
goto chkresume
:Childq_NOBUTTON
file delete,@path(%0)\resume.log
:Childq_CancelBUTTON
:Childq_CLOSE
DIALOG CLOSE
wait event
%E = @event()
end
goto rerun
:chkresume
if @equal(%%resumeNOW,YES)
dialog set,MODE,Resume
if @file(@path(%0)\LU.ini)
%C = 0
repeat
%E = @ras(item,%C)
if %E
list add,c1,%E
end
%C = @succ(%C)
until @null(%E)
list seek,c1,0
goto resume
end
:rerun
dialog set,MODE,Normal
REM Return to the main script.
REM This belongs in the evloop or timer rountine
REM This section writes the resume.log, it download is complete
REM then delete the resume.log when finished.
if @equal(%%download,open)
%%size = @internet(http,content-length,2)
%%left = @internet(http,transferbytes,2)
dialog set,dt3,Transferred: %%left Bytes of %%size Bytes
list create,8
REM %%logurl is http://www.yourdoman.com
REM %%logname is setup.exe
list add,8,%%left|%%size|%%logURL|%%logNAME
list savefile,8,resume.log
list close,8
end
REM Resume rountine
:resume
REM This informs the user that Live Update is reusming a download.
extlist list,add,l1,Live Update is attempting to resume|1b.bmp
extlist list,add,l1,Last Update Failed....|2b.bmp
extlist list,clear,l1
list create,9
list loadfile,9,resume.log
%%HG = @item(9)
PARSE "%%LEFTR;%%SIZER;%%URLR;%%NAMER",%%HG
%%donot = 1
REM Set the resume to continue where the download ended
INTERNET HTTP,RANGE,2,%%LEFTR,%%SIZER
extlist list,add,l1,Resuming: %%leftr to %%sizer bytes.|1b.bmp
internet http,download,2,%%URLR,%%NAMER
extlist list,add,l1,%%urlr|1b.bmp
extlist list,add,l1,Some Servers do not support Resume.|2b.bmp
dialog set,t3,Resuming Download....
%%stat = DOWN
%%download = open
goto evloop
end
goto evloop
|
I hope this is not too confusing, Nathan |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Mar 28, 2003 12:27 pm Post subject: |
|
|
Thanks Nathan  |
|
| Back to top |
|
 |
LOBO Valued Contributor


Joined: 14 Mar 2002 Posts: 241 Location: Wilmington, Delaware, USA
|
Posted: Fri Mar 28, 2003 12:44 pm Post subject: |
|
|
Yes, Thanks Nathan.
-Mark |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Fri Mar 28, 2003 2:12 pm Post subject: |
|
|
thanks Rubes_sw more code for me to play with  _________________ Have a nice day  |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Mar 28, 2003 7:49 pm Post subject: |
|
|
Thanks a LOT Nathan!
This will certainly help me.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Sat Apr 05, 2003 3:10 am Post subject: |
|
|
Very nice example there Nathan... thank you!  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|