I'm trying to have iTextSharp create a PDF file of the web page and save it to the users computer C drive. This works in debug but when I publish it to the server files never get saved on the computer but the application is saying that it did save it. I think I need to set my path differently. This is in MVC4 C#.
var pdfDoc = new Document();
const string folderPath = "C:\\SG-ListingPDFs\\";
bool isExists = Directory.Exists(folderPath);
if (!isExists)
Directory.CreateDirectory(folderPath);
var writer = PdfWriter.GetInstance(pdfDoc, new FileStream("C:\\SG-ListingPDFs\\" + detailsViewModel.ListingNumber + ".pdf", FileMode.Create));
pdfDoc.Open();
//Code here
pdfDoc.Add(table);
TempData["SavedPdF"] = true;
pdfDoc.Close();