Nancy
Nancy copied to clipboard
MemoryStream Copy to ResponseStream failed
the
ms.Copyto(s)
is failed to response the image
var bytes = ms.ToArray();
s.Write(bytes, 0, bytes.Length);
this is ok to response the image.
Where I am wrong ?
- Nancy version: 2.0.0-clinteastwood
- Nancy host
- [ ] ASP.NET
- [x] OWIN
- [ ] Self-Hosted
- Environment (Operating system, version and so on): windows 10 14393.969
- .NET Framework version: .net core 1.1
Try this
public class ByteArrayResponse : Response
{
///
this.Contents = stream =>
{
using (var writer = new BinaryWriter(stream))
{
writer.Write(body);
}
};
}
}
@jchannon ok, thx.
