c# - Error in downloading a file from folder,path is in database language used -
error message
"requested url: /selva/ddl commands.doc"
actually file path should
url:/selva/docs/ddl commands.doc
code have used :
linkbutton lnkbtn = sender linkbutton; gridviewrow gvrow = lnkbtn.namingcontainer gridviewrow; string filepath = gvdetails.datakeys[gvrow.rowindex].value.tostring(); response.contenttype = "application/doc"; response.addheader("content-disposition", "attachment;filename=\"" + filepath + "\""); response.transmitfile(server.mappath("~/+ filepath + ")); response.end();
in aspx
what may mistake can 1 me pls. in advance.
try this
response.clear(); response.appendheader("content-disposition", "attachment; filename=xxxxxx.doc"); response.contenttype = "application/msword"; response.writefile(server.mappath("/xxxxxxx.doc")); response.flush(); response.end();
Comments
Post a Comment