简体   繁体   English

使用文件重定向到.aspx页

[英]Redirect to .aspx page with a file

I have a web forms .aspx page that usually handles get requests and simply displays some content.. nothing fancy. 我有一个Web表单.aspx页面,通常处理获取请求并仅显示一些内容。 I have a new case where sometimes, I would need to redirect to this page but also send a file. 我有一个新案例,有时我需要重定向到此页面,但还要发送文件。 Could I simply do this as a POST request and write the file to the body of the request, or is this bad practice? 我可以简单地将其作为POST请求并将文件写入请求的正文中,还是这种不好的做法? I could write the file to a NAS before redirecting and then have my .aspx page read from the NAS once it gets the request but that seems expensive. 我可以在重定向之前将文件写入NAS,然后在收到请求后从NAS读取.aspx页,但这似乎很昂贵。

Any ideas would be much appreciated. 任何想法将不胜感激。

您显然需要在服务器上进行一些文件验证,但是,如果您使用的是实际的文件上传方法,则应该可以访问Request.Files对象以进一步处理文件上传。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM