how do i send a large file (more than 64k) via winsock?
Printable View
how do i send a large file (more than 64k) via winsock?
open the file into a byte array
dim bytes()
redim bytes(filelen("c:\test.txt")
'after connecting etc
winsock.senddata bytes
Then to recieve ... (append arrived data to a file)
Private Sub wsTCP_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim buffer() As Byte
wsTCP(1).GetData buffer
Put #1, lPos, buffer
lPos = lPos + UBound(buffer) + 1