none
Locally hosted project download the file, Server Hosted project not downloading file RRS feed

  • Question

  • Hello All

    I have a MVC 4.0 Project which has .Net 4.5 framework

    If I locally run project then it download excel file but if i host project on server then it not downloading file

    I delete the file after downloading, it locally work successfully, but not in server

    My Code for download is

        Response.Clear();
                Response.ContentType = "application/octet-stream";
                Response.AddHeader("content-disposition", "attachment;filename=UtilizationShortFall.xlsx");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.WriteFile(templatePath);
                Response.Flush();
                System.IO.File.Delete(templatePath);
                Response.End();

    Is there any IIS permission issue.....???

    Thanks

    Manish


    Manish K. Bhalodi

    • Moved by Bob Shen Friday, June 21, 2013 5:35 AM
    Thursday, June 20, 2013 9:24 AM

Answers