使用 AppSelfHostBase 的自托管服务堆栈主机有一个服务方法:public object Any(UploadImageRequest request){ // Need to make sure the file is not too large!}[Route("/UploadImage")]public class UploadImageRequest : IRequiresRequestStream{ public Stream RequestStream { get; set; }}
1 回答
拉莫斯之舞
TA贡献1820条经验 获得超10个赞
我实际上找到了一种可能的方法:
public object Any(UploadImageRequest request)
{
if (Request.ContentLength > 10 * 1024 * 1024)
{
return new HttpResult($"Image too large!", HttpStatusCode.RequestEntityTooLarge);
}
...
}
- 1 回答
- 0 关注
- 112 浏览
添加回答
举报
0/150
提交
取消