I want to use the opening Pdf file, and the User inputs some of the fields and then saves this file into the Specific folder in my Asp.net
folder.
I try to use the HttpPostedFileBase
file but I cannot save this file to a folder, always become null for Parameter. Is it working right? You guys have any other idea for open Pdf and edit, save as pdf file to a folder?
<form method="post" enctype="multipart/form-data">
<div>
<embed name="file" src="~/AnnounceFile/PDF.pdf"
style="width: 780px; height:980px;"
class="with-200" />
<button type="submit">Import</button>
</div>
</form>
Controller
[HttpPost]
public ActionResult Index(HttpPostedFileBase file)
{
string filename = Guid.NewGuid() + Path.GetExtension(file.FileName);
string filepath = "/folder/" + filename;
file.SaveAs(Path.Combine(Server.MapPath("/excelfolder"), filename));
InsertExceldata(filepath, filename);
return View(db.Iteminfoes.ToList());
}