|
-
Jul 7th, 2006, 07:58 PM
#1
Thread Starter
New Member
Winsock help (please) :/
Hi all,
I'm trying to make a download manager that downloads files from my website. It works when I download smaller files, but large zip file come back as corrupt. Is there an explanation for this?
Thanks
-
Jul 7th, 2006, 08:08 PM
#2
Member
Re: Winsock help (please) :/
This is probaly down to somthing called MTU (Maximum Transmission Unit).
This fragments data into packets of around about 1,500 Bytes so it can easily be routed across the interent. I belive to overcome this problem you need to stick all these packets together as winsock receives them. It may be easier to use the Inet control to deal with large files as it does all this automaticly.
Hope that helps.
-
Jul 7th, 2006, 08:23 PM
#3
Thread Starter
New Member
Re: Winsock help (please) :/
Thanks CJ. I'm not sure if that's the route I want to go though (as i'm so far with this method). I will def. give it a look if this way doesn't work !
I was thinking of splitting the zip file into smaller files. Does anyone know how to do this?
-
Jul 7th, 2006, 10:59 PM
#4
PowerPoster
Re: Winsock help (please) :/
How large are the files that are failing ..?
Last edited by rory; Jul 7th, 2006 at 11:02 PM.
-
Jul 7th, 2006, 11:10 PM
#5
Thread Starter
New Member
Re: Winsock help (please) :/
-
Jul 7th, 2006, 11:19 PM
#6
PowerPoster
Re: Winsock help (please) :/
thats small .. anyway you need to add the data together as it comes in then write it to a file when it is complete
on data arrive .. example ..
Winsock1.GetData strData, vbString
ReceiveData = ReceiveData & strData
then on winsock close ..
intFile = FreeFile
Open TempFile For Binary As #intFile
Put #intFile, , ReceiveData
FileClose
see attachment ..downloads files and webpages.. could use more done to it, but it works .. ive downloaded 400mb files with it .. i just havent had time to complete it such as customise it more with text entry boxes for URL etc ..
you could also have them write to temp files as they are downloading and create your own auto resume program if it is paused, but ill leave that to you ;-)
Rory
Last edited by rory; Nov 11th, 2006 at 02:53 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|