How to save Rotativa PDF on server

后端 未结 4 1540
花落未央
花落未央 2020-12-31 11:37

I am using Rotativa to generate PDF in my \"MVC\" application. How can I save Rotativa PDF? I need to save the document on a server after all the process is completed.

4条回答
  •  一生所求
    2020-12-31 12:12

    You can simply try this:

    var fileName = string.Format("my_file_{0}.pdf", id);
    var path = Server.MapPath("~/App_Data/" + fileName);
    System.IO.File.WriteAllBytes(path, pdfByteArray );
    

提交回复
热议问题