|
-
Jul 4th, 2001, 04:42 PM
#1
Thread Starter
New Member
Send a file in blocks
I'm sending a large file in blocks. When it gets to the client how do I write to the file? Do I open the file with a wrtie and then next time it gets called make sure it only appends?
I'm sending the file using a byte array, but when I writing to the file I'm using a string from the winsock.GetData.
-
Jul 4th, 2001, 04:49 PM
#2
Fanatic Member
On the other side, after you get the string, convert it into a byte array, then stick it in the file.
VB Code:
'assuming you had a binary file open with handle 1, and strData is the incoming data string
Dim abyteBuffer() As Byte
abyteBuffer = StrConv(strData, vbFromUnicode)
Put #1, , abyteBuffer
You'll probably want to have the file opened from outside the DataArrival event, and then close it when you're done, otherwise you'll have to track where the last file writing operation took place, reopen the file, and seek to that position before writing again.
I'm baaaack...
VB5 Professional Edition, VC++ 6
Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se
I feel special because I finally figured out how to loop midis: Post link
I'm a fanatic too 
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
|