2

I have an async service, and I must transfer a file from the client to the service. The service is configurated to use the streamed transfer mode, so if I am not wrong, the file is transferred without wait to load all the file.

I would like to know how I can know if the file is finished, because I need to convert this stream to be able to convert this stream into a byte[] to store the file in the database.

i ask this because when I receive the file in the service from the client, I receive a read only stream, with length property available, and I have problems to convert this stream into the byte array.

Thanks.

Álvaro García
  • 18,114
  • 30
  • 102
  • 193

1 Answers1

1

Why not create a memory stream and then readbyte into an array?

MemoryStream ms = new MemoryStream(dataHERE)
byte[] passing = ms.ReadByte(); 
dudebroman
  • 256
  • 2
  • 4
  • 12