Winsock problem

Results 1 to 2 of 2

Thread: Winsock problem

  1. #1
    Join Date
    Dec 1969

    Default Winsock problem

    I&#039;m doing a little app that uses Winsock to upload files from one place to the other. They can be files of any type.<BR>What I need to do is open my file for binary access on the client, read it into a byte array and send it.<BR>Heres my code for that:<BR>Dim byteIn As Byte<BR> Dim aMsg() As Byte<BR> Dim lPtr As Long<BR> <BR> Open localPath.Text For Binary Access Read As #1<BR> lPtr = 0<BR> bEOF = False<BR> <BR> Do While Not bEOF<BR> Input #1, byteIn<BR> If Err.Number &#060;&#062; 0 Then<BR> bEOF = True<BR> Err.Clear<BR> Else<BR> ReDim Preserve aMsg(lPtr + 1)<BR> aMsg(lPtr) = byteIn<BR> lPtr = lPtr + 1<BR> End If<BR> Loop<BR><BR> Winsock1.SendData aMsg<BR><BR>This does not seem to work. i don&#039;t have much experience of binary files so this is causing me some hassle.<BR>My server programme needs to get what is sent and open the binary file and write it to its desired location. I&#039;m at a loss how to do this so if anyone has any ideas, they might find their way onto my christmas code.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Winsock problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts