My WCF project uses Mtom and streaming, and set the MaxBytesPerRead to 32K (on client and server) but when I run
read = fs.read(buffer, 0, buffer.length)
it doesn't let me read more than 4096 bytes (4k) at a time (the 32K buffer doesn't fill up- it's padded with zeroes)
Is there any way I can stream my multi-megabyte file in chunks larger than 4K (please say yes) ???
4096 is the default size for the read buffer on a FileStream
, which I assume is what your are returning. I am not really sure how the 4k limit is affecting you, but your alternative is to read the entire file into a MemoryStream and send it that way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With