doramail05
asked on
Retrieving the browsed path in the file dialog & save it using the browsed path in future
By using the code, it would save the pdf file to the browsed location in the file dialog
just if possible if it could anyhow retrieve the browsed location (from the file dialog) to a textbox
and use path in the textbox and save the pdf file back to this path (from the textbox) ?
just if possible if it could anyhow retrieve the browsed location (from the file dialog) to a textbox
and use path in the textbox and save the pdf file back to this path (from the textbox) ?
private static void SetResponse(string fileName)
{
string attachment = "attachment; filename=" + fileName + ".pdf";
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearHeaders();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", attachment);
HttpContext.Current.Response.ContentType = "pdf";
HttpContext.Current.Response.AddHeader("Pragma", "public");
}
protected void btnSave_Click(object sender, EventArgs e)
{
FileStream fs = File.OpenRead(Server.MapPath("~/Scripts/1.pdf"));
byte[] buffer = new byte[(int)fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
fs.Close();
SetResponse("pdfName");
HttpContext.Current.Response.BinaryWrite(buffer);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
dNextCopyRunningNumber += 1;
bSaved = true;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is not much response because the only answer is #a39865092
ASKER
not much response