Currently I'm trying to find a way to automatically create a new folder to save a PDF into it or either save it in a common file all computers have or make my browser pop-up run a "save as" and "save to" function whenever the client click the download button. which is typically how people try to download PDF/ZIP in other websites.
My webapp basically allow the user is trying to download the PDF from my server-side code
As you can see from my codes, I have been trying ways to save my PDF file and this is how i try to save my PDF in a hard-coded directory like this
var doc1 = new Document();
var filename = "Official Report" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".pdf";
var output = new FileStream(Path.Combine("C:/Users/apr13mpsip/Downloads", filename), FileMode.Create);
iTextSharp.text.pdf.PdfWriter.GetInstance(doc1, output);
How do i use the
server.mappath("");
or how do i automatically create a new folder when trying to download the PDF file.