Hi!
Thanks for the reply.
I am doing a client server which I have to like attach files and send it over to the server, which the server will receive it and save it.
I am currently doing it through TCP connection, however I still have to slice the data up to pass through the network because my files tend to be big.
At the server, I am using Binary Writer to write back into a file, eg: if I send a image file of file name "image.jpg", the server will receive this "image.jpg" and save it into its own directory.
At the client side, I am using FileStream to extract the data of the file into byte array. But at the server side when all the different segments are received, it will use Binary Writer to save into a file in its own directory.
However I am experiencing that the file is corrupted and the image cannot be seen. I was wondering if whether will there be compatibility problems between FileStream & BinaryWriter. So I'm asking whether is there a BinaryWriter equivalent of the codes using FileStream.
Thanks!
|