forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Pausing/resuming/finding if resume is available with VDSIPP

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 27, 2003 9:06 pm    Post subject: Pausing/resuming/finding if resume is available with VDSIPP Reply with quote

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. Very Happy

Thanks. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Thu Mar 27, 2003 9:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Mar 27, 2003 9:47 pm    Post subject: Reply with quote

Thanks. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Thu Mar 27, 2003 11:38 pm    Post subject: Reply with quote

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 Smile

_________________
Have a nice day Smile
Back to top
View user's profile Send private message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Fri Mar 28, 2003 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Fri Mar 28, 2003 12:27 pm    Post subject: Reply with quote

Thanks Nathan Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Fri Mar 28, 2003 12:44 pm    Post subject: Reply with quote

Yes, Thanks Nathan. Very Happy


-Mark
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Fri Mar 28, 2003 2:12 pm    Post subject: Reply with quote

thanks Rubes_sw Smile more code for me to play with Smile
_________________
Have a nice day Smile
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Mar 28, 2003 7:49 pm    Post subject: Reply with quote

Thanks a LOT Nathan! Very Happy
This will certainly help me. Very Happy

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Hortalonus
Valued Contributor
Valued Contributor


Joined: 15 Mar 2002
Posts: 344
Location: Western USA

PostPosted: Sat Apr 05, 2003 3:10 am    Post subject: Reply with quote

Very nice example there Nathan... thank you! Smile
_________________
"ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player...
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group