|
-
Sep 24th, 2000, 10:58 PM
#7
Lively Member
When sending the picture using the winsock control send it binary not TEXT(ASCII). Also you need to declare a variable as a byte array not a string. Your code would look something like this.
Dim bySend() as Byte
Dim Buffer as Integer
Dim FileSize as Long
Dim NumberOfBytesSentSoFar as Long
Dim iFile as Integer
iFile = FreeFile
Open FileToSend For Binary As #iFile
FileSize = LOF(iFile)
NumberOfBytesSentSoFar = 0
Do Until NumberOfBytesSentSoFar >= FileSize
'Set buffer to the # bytes you want to send
Buffer = 4096
If Buffer > FileSize - NumberOfBytesSentSoFar Then
Buffer = FileSize - NumberOfBytesSentSoFar
End If
'Input Binary
bySend() = InputB(Buffer, iFile)
Winsock.SendData bySend()
NumberOfBytesSentSoFar = NumberOfBytesSentSoFar + buffer
Loop
Close iFile
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|