i explain my issue here
asp.net web application name as uploadsi got a function that should download this as
private void downloadAnImage(string strImage) { Response.ContentType = "image/jpg"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + strImage); Response.TransmitFile(strImage); Response.End(); }and i call this function from link button as
protected void lnkDwnSlc_Click(object sender, EventArgs e) { if (Session["slc_filepath"] != null) { string path = Server.MapPath(Session["slc_filepath"].ToString()); downloadAnImage(path); } }where Session["slc_filepath"] is path stored in session
but after running this code file/image is not downloading and I got no error about why file is not downloading. And I checked file path by using breakpoint , it is correct,
I search a lot form google but i can't understand where I missed something.
EDIT: on page load event i pull records from table there i saved path of file and in session i store it like
Session["slc_filepath"] = dt.Rows[0]["UploadSLC"].ToString();where UploadSLC is column name of table where i store path of image and in database string is looking as
~\uploads\ab071770-473a-4e1a-8cfc-addeccf565d5.jpg
Krishna Rajput SinghPosted Nov 5, 2015, 11:10 AM