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
Printable View
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
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.
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?
How large are the files that are failing ..?
around 80-100MB
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