-2

I want to try this in order to discard a possibility of why my code is not working as expected. Thanks in advance!

SantLev
  • 140
  • 3
  • 15

1 Answers1

0

Just pass steam that has CanWrite set the way you want in constructor. MemoryStream is an option as it allows both R/O and R/W modes.

I.e. if you just need some result use following (indeed you can pass real data as buffer too):

return new FileStreamResult(new MemoryStream(new byte[4], writable:false));
Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179