Uploading file with WCF streaming, tiny reads from stream -


I have implemented file uploads using WCF streaming, everything works as expected, though I have a problem Has to face: I am allocating a 4kb buffer to read from the incoming stream, but the WCF reads only 255 bytes. This is my upload function:

  Public UploadResponse UploadFile (FileDto fileDto) {using (var inStream = fileDto.FileStream) (var outstream = New FileStream ("OutFile.txt", FileMode. Create) (Var buffer = new byte [4096]; integer number; Return to the new upload repository {documentId = -1} ( gt; {outstream.Write (buffer, 0, count);}  

are reading only 255 bytes on this line: while ((count = inStream.Read (buffer, 0, buffer.length))> 0) Can I change any settings, or Am I doing something wrong?

If you can please configure defaults or redundancy values Should be specified, as something below:

  & lt; not binding Max = "File TransferServicesBadding" MaxRiecevysesism = "1048576" Message encoding = "AMTOM">  

With this attempt, the man mentions that he only has problems with obtaining 255 bytes , He has an answer and it seems to solve his issue. It has been said:

"To pass a stream to a WCF method, there should be the only parameter in the stream parameter operation (or message body) ..."


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -