1
我使用提交按钮创建了一个PDF表单,该按钮将其发送到我的网站,该表单处理该表单并将其存储以供以后使用。在服务器上检索提交的PDF表单
在我的网站上,我想采用已发布的pdf格式,并将其保存。但是,我无法找到如何将传入流转换回PDF。
这是代码我现在有其它
[HttpPost]
public string PostPDF()
{
using (var sr = new System.IO.StreamReader(Request.InputStream))
{
var fdfStream = sr.ReadToEnd();
}
...
return "Form submitted successfully!";
}
事我试图进行接收httpPostedFileBase和一个byte [],如下所示:
[HttpPost]
public ActionResult PostPDF(HttpPostedFileBase file)
[HttpPost]
public ActionResult PostPDF(byte[] file)
而这两者都是空的结果。
'HttpPostedFileBase'应该是正确的选择。检查这个博客关于MVC文件上传http://www.prideparrot.com/blog/archive/2012/8/uploading_and_returning_files –