need more help with resume
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:
dim lengthfile as double
lengthfile = FileLen(.FileName)
Open .FileName For Binary As #1
xTransfer = True
winsock1.SendData "|RESUME|" & lvFiles.SelectedItem.Key & lengthfile
server side recieves this,
VB Code:
Private Sub winsock1_DataArrival(ByVal bytesTotal As Long)
Dim recievedataAs String
winsock1.GetData recievedata
resumesendFile ?????? ,winsock1
End sub
VB Code:
Public Sub ResumeSendFile(FileName As String, WinS As Winsock)
Dim FreeF As Integer
Dim LenFile As Long
Dim nCnt As Long
Dim LocData As String
Dim LoopTimes As Long
Dim i As Long
FreeF = FreeFile
Open FileName For Binary As #99
nCnt = 1
LenFile = LOF(99)
WinS.SendData "|FILESIZE|" & LenFile
DoEvents
Sleep (400)
Do Until nCnt >= (LenFile)
LocData = Space$(1024)
Get #99, nCnt, LocData
If nCnt + 1024 > LenFile Then
WinS.SendData Mid$(LocData, 1, (LenFile - nCnt))
Else
WinS.SendData LocData
End If
nCnt = nCnt + 1024
Loop
Close #99
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 ?