mIRC Home    About    Download    Register    News    Help

Print Thread
Socket download #19363 15/04/03 05:56 PM
Joined: Jan 2003
Posts: 148
K
Knappen Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
I making a socket update script for my script and I`m wondering how I actually download the new file (e.g newversion.exe) to my computer and where it`s laid...

Thanks! smile

Re: Socket download #19364 15/04/03 09:53 PM
Joined: Mar 2003
Posts: 9
A
aeternus Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
A
Joined: Mar 2003
Posts: 9
If you can't do that, don't depend on other's work. You can always tell user how to download an update using www browser. If you want to learn sockets, go to www.mircscripts.org -> tutorials. Don't rip, it's so lame.

Re: Socket download #19365 16/04/03 07:42 AM
Joined: Feb 2003
Posts: 47
G
guesseyder Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
Giving some guidelines isn't too much to ask imo smile

You'd need to do the following steps (might miss one or two, it's early for me smile )

1) Make connection with fileserver where update file is located ( /help /sockopen )
2) On connection, send the file request (HTTP request i assume, so you need to study the HTTP protocol to find out how the request looks like) ( /help /sockwrite )
3) Server will be sending the file-data, store this info in a new file ( /help /sockread /help /write )
4) When filetransfer is completed, close connection ( /help /sockclose )

The idea is pretty obvious but the /help <command> should point you to your way.

Re: Socket download #19366 16/04/03 05:22 PM
Joined: Jan 2003
Posts: 148
K
Knappen Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
Thanks! But it really doesn`t help me much... I`ve figured out where the file is laid. I tried to use bwrite to copy the file from the server but it only downloads 210 kb and there is no filename... What do I do?

Plis help me! Thanks!

Re: Socket download #19367 16/04/03 08:14 PM
Joined: Feb 2003
Posts: 47
G
guesseyder Offline
Ameglian cow
Offline
Ameglian cow
G
Joined: Feb 2003
Posts: 47
Well post the part of your script where you are trying to download it so we (or I) can point out any mistakes or flaws.

If you actually read 210kb of the file then you are probably doing something wrong in your while loop where you retrieve data from the server.

Re: Socket download #19368 16/04/03 09:07 PM
Joined: Jan 2003
Posts: 148
K
Knappen Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
I got it to work! I joined #help and got a guy there to help me...
But thanks for your help and interest!