Unable to download file from server
-
Hi I am not able to download file from Web Server... I am using following code
string filename = "Resume.doc"; string path = Server.MapPath("~/Resumes/" + filename ); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment;
filename=" + filename );
Response.ContentType = "application/octet-stream"; Response.WriteFile(path); Response.End();
this code is working fine in localhost... but when Execute in the server it says 'File not found in the Directory',but file exists on the server. The website id done in ASP only the file upload and download is done in ASPX, upload is working fine but download is creating the problem. may be because of Version compatibility,I am using GODaddy Share WebHosting. please help me to find the solution. Thanks and Regards Vayanan
-
Hi I am not able to download file from Web Server... I am using following code
string filename = "Resume.doc"; string path = Server.MapPath("~/Resumes/" + filename ); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment;
filename=" + filename );
Response.ContentType = "application/octet-stream"; Response.WriteFile(path); Response.End();
this code is working fine in localhost... but when Execute in the server it says 'File not found in the Directory',but file exists on the server. The website id done in ASP only the file upload and download is done in ASPX, upload is working fine but download is creating the problem. may be because of Version compatibility,I am using GODaddy Share WebHosting. please help me to find the solution. Thanks and Regards Vayanan
-
vayanan wrote:
string path = Server.MapPath("~/Resumes/" + filename );
Try to print the file path on screen and then check....
Regards Aman Bhullar www.arlivesupport.com[^]
-
Hi Thanks for your kind reply.. Path is correct only.. It is working fine when I use the same code in different Domain in the same server