Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

Locally hosted project download the file, Server Hosted project not downloading file

$
0
0

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


Viewing all articles
Browse latest Browse all 7363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>