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 


Scripting help...

 
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: Wed Apr 16, 2003 9:41 pm    Post subject: Scripting help... Reply with quote

Hello all,

I have been trying unsuccessfully for quite a while now to try and create
a sort of downloader with pausing avaiable. I know I shouldn't be asking
for this type of help but I just can't figure it out. Can anyone write a
simple, basic script that works with the VDSIPP extension to
pause/resume a download that has already been started?

Why I want to create this is because when I am downloading a large
file but want to browse the internet quickly it gets mighty slow on a
56k connection.

Thanks for any help or tips, large or small. Very Happy Very Happy Very Happy Very Happy
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Apr 16, 2003 10:56 pm    Post subject: Reply with quote

hi ff,

can't help you with pause/resume but can help you with stop Sad

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Apr 16, 2003 11:00 pm    Post subject: Reply with quote

This is what the VDSIPP help file says about resuming a download, but I
don't understand it. Sad

Quote:
INTERNET HTTP,RANGE,<http client>,<start-byte>,<end-byte>

This command allows you to download a certain part of a file. This allows you to only download portions of a file when you choose to. It's convenient as it allows you to resume a download or only download the part of a file you need. The <start-byte> parameter specifies the byte where to start the download. The <end-byte> parameter specifies the byte where to stop the download. This command will only work with the INTERNET HTTP,DOWNLOAD command, to download portions of a file. Please note that not all http servers allow you to specify the RANGE, you should check by trying to download portions of a file from the http server in question to see if it works or not. Also note that the RANGE will only work on binary/downloadable type files.


I really appreciate your help on this Serge! Very Happy
Perhaps all that needs to be done is to have an outline of the process that
needs to be used to pause/resume the download. Smile

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Apr 16, 2003 11:12 pm    Post subject: Reply with quote

hi ff,

the way i read this is that if you stop a download, you can then resume it by using the <start-byte> and <end-byte>

the <start-byte> refers to the last byte of the part of the file you have downloaded so far +1 (the +1 is to start getting the next byte)

the <end-byte> refers to the last byte of the file you want to download

you will therefore need to get the last byte of the part of the file you have downloaded (on your computer) and the end byte of the file that you want to download (on the download server)

does that make sense to you?

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Apr 16, 2003 11:21 pm    Post subject: Reply with quote

Yes it does but how do I get the end-byte? And it also mentions that some
servers don't support resume... how would I test that? Confused

Thanks. Smile

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Wed Apr 16, 2003 11:40 pm    Post subject: Reply with quote

how about:

- <start-byte> get the file size locally from your computer or use the following to keep track of how much you have downloaded
Quote:
@INTERNET(FTP,TRANSFERBYTES,<ftp client>)
This function returns the current size in bytes of the file being transfered/received, the command FTP THREADS should be set to the ON mode for this function to work

Copyright © 2001 PGWARE / All rights are reserved.


- <end-byte> use the following

Quote:
@INTERNET(FTP,FILEINFO,<ftp client>,<raw data>,<params>)
This function was added in to allow you to easily parse a filename, size, and type from the data that is returned by the @INTERNET(FTP,FILELIST) function. You should only pass a single line of <raw data> returned from the @INTERNET(FTP,FILELIST) function to this function to return the <params> required. The following <params> are allowed:

N - returns the filename (long file names not supported)
S - returns the file size

T - returns the file type (0: Directory; 1: Link; 2: File)

Copyright © 2001 PGWARE / All rights are reserved.


as for testing it, what about
Quote:
@INTERNET(FTP,RETURNCODE,<ftp client>)

Copyright © 2001 PGWARE / All rights are reserved.

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Apr 16, 2003 11:55 pm    Post subject: Reply with quote

This is what I have so far...

Code:
Title Pause/Resume
external vdsipp.dll
  DIALOG CREATE,Pause/Resume,-1,0,300,95
  DIALOG ADD,TEXT,TEXT1,10,10,,,URL of File:
  DIALOG ADD,EDIT,file,24,8,282,19
  DIALOG ADD,BUTTON,Download,55,36,,,Download
  DIALOG ADD,BUTTON,Pause,54,110,64,24,Pause
  DIALOG ADD,BUTTON,Stop,54,182,64,24,Stop
  DIALOG SHOW
INTERNET HTTP,CREATE,1
INTERNET HTTP,THREADS,1,ON
INTERNET HTTP,PROTOCOL,1,1
INTERNET HTTP,USERAGENT,1,"Test Downloader Alpha"
:Evloop
  wait event
  goto @event()
:DownloadBUTTON
  INTERNET HTTP,DOWNLOAD,1,@dlgtext(file),c:\testfile.html
  goto evloop
:PauseBUTTON
if %%paused
dialog set,pause,Pause
%%paused = ""
else
  %%lastbyte = @INTERNET(HTTP,TRANSFERBYTES,1)
  %%paused = 1
  dialog set,pause,Unpause
end
  goto evloop
:StopBUTTON
  INTERNET HTTP,STOP,1
  goto evloop
:Close
  INTERNET HTTP,STOP,1
  INTERNET HTTP,DESTROY,1
exit

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


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Apr 17, 2003 12:08 am    Post subject: Reply with quote

i'm sorry ff but i have to go now and can't follow on with helping you Sad

i will log on later today - my time (it's 10:07 am here now)

let me kow how you went

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Apr 17, 2003 12:10 am    Post subject: Reply with quote

That's OK Serge, I'm starting to get it now. Very Happy
Thanks for your help. Very Happy

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


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Apr 17, 2003 12:28 am    Post subject: Reply with quote

It's 7:28 PM here. Shocked Wink
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Thu Apr 17, 2003 7:31 am    Post subject: Reply with quote

glad to see that you are working it out...i don't think that it should be too hard to do but then again...

Serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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