Hi
I've implemented file uploading using WCF's streaming. Everything works as expected, however i faced one issue: i'm allocating 4kb buffer to read from incoming stream, but WCF reads only 255 bytes. Here is my upload function:
public UploadResponse UploadFile(FileDto fileDto)
{
using (var inStream = fileDto.FileStream)
using (var outStream = new FileStream("OutFile.txt", FileMode.Create))
{
var buffer = new byte[4096];
int count;
while ((count = inStream.Read(buffer, 0, buffer.Length)) > 0)
{
outStream.Write(buffer, 0, count);
}
}
return new UploadResponse {DocumentId = -1};
}
Only 255 bytes reading at this line: while ((count = inStream.Read(buffer, 0, buffer.Length)) > 0). Is there any setting i can change, or am i doing something wrong?