Ok i want to resume a file from a client server setup and this is what i have so far,


client side gets file length of local file that is partially downloaded already and sends this info to server,


VB Code:
  1. dim lengthfile as double
  2. lengthfile = FileLen(.FileName)
  3. Open .FileName For Binary As #1
  4. xTransfer = True
  5.             winsock1.SendData "|RESUME|" & lvFiles.SelectedItem.Key & lengthfile

server side recieves this,

VB Code:
  1. Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)
  2.  Dim recievedataAs String
  3. winsock1.GetData recievedata
  4.  
  5. resumesendFile ?????? ,winsock1
  6.  
  7. End sub


VB Code:
  1. Public Sub ResumeSendFile(FileName As String, WinS As Winsock)
  2.  
  3. Dim FreeF As Integer
  4. Dim LenFile As Long
  5. Dim nCnt As Long
  6. Dim LocData As String
  7. Dim LoopTimes As Long
  8. Dim i As Long
  9.  
  10. FreeF = FreeFile
  11.  
  12. Open FileName For Binary As #99
  13.  
  14. nCnt = 1
  15.  
  16. LenFile = LOF(99)
  17.  
  18. WinS.SendData "|FILESIZE|" & LenFile
  19. DoEvents
  20.  
  21. Sleep (400)
  22.  
  23.  
  24. Do Until nCnt >= (LenFile)
  25.  
  26.     LocData = Space$(1024)
  27.  
  28.  
  29.   Get #99, nCnt, LocData
  30.  
  31.  
  32.   If nCnt + 1024 > LenFile Then
  33.       WinS.SendData Mid$(LocData, 1, (LenFile - nCnt))
  34.   Else
  35.  
  36.     WinS.SendData LocData
  37.   End If
  38.  
  39.   nCnt = nCnt + 1024
  40.  
  41. Loop
  42.  
  43. Close #99
  44.  
  45. End Sub

so according to this i think i have to make nct the value of the client side filelength. Could be way off but thats the way it looks to me.

any suggestions ?