1. problems downloading file

I am using tcp4u to dl a zip file, and i keep getting this 
error when i try to extract using winzip:

warning [F:/path/zips/af.zip]:  extra 16497 bytes at beginning 
or within Zip file (attempting to process anyway)
Error in file #1:  bad Zip file offset (Error local header 
signature not found):  0

If i dl the file using IE, winzip has no problems with it. 
Here's the code block that gets the bytes from the internet and 
appends them to the local copy:

------------------------------------------------------
global function ReadServer() -- interface to tcp4u.ew

sock_receive = ""
sock_receive = tcp4u_receive(sock,50000,0)
if ( length(sock_receive[2]) > 0 ) then return sock_receive[2] 
end if
return ""
end function -- readserver

----------------------------------------------------------------


while 1 do
 junk = ReadServer() 
 if match("Content-length",junk) then
   junk2 = junk[match("Content-length",junk)..length(junk)]
   junk2 = junk2[1..match("\n",junk2)-1]
   puts(1,junk2)
   junk2 = junk2[16..length(junk2)-1]
   junk2 = value(junk2)
   neededlen = junk2[2]
 end if
 if not equal(-1,junk) and not equal("",junk) and not 
match(junk,TheWebPage) then
   TheWebPage &= junk
   readcount = 0
 end if
 junk2 = sprintf("%2.0f",(length(TheWebPage)/neededlen ) * 100)
 if ( match(".",junk2) > 0 ) then
   junk2 = junk2[1..match(".",junk2)-1]
 end if
 titlebar(logurls[urlloop] &
          " -- getting -- file length: " &
          sprintf("%d",length(TheWebPage)) &
          " -- " &
          junk2 & "%")
 if (readcount > 30) then exit end if -- if we got nothing for 
30 seconds, the server has gone poof
 sleep(1) -- let the dialup play catch-up
 readcount += 1
 end while


Can anyone see where the extra 16497 bytes are coming from? 
It's the same extra count each and every time i run it on that 
one file.

Kat,
puzzled.

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu