Quantcast
Channel: How to download a file using ASP.NET - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Mohamed Farrag for How to download a file using ASP.NET

$
0
0

In your code just change this line :

Response.TransmitFile(Server.MapPath(file));

to

Response.TransmitFile(file);

This because of you are sending the physical path not the virtual path as Server.MapPath expects. Also read this article it will help you to understand how to deal with Server.MapPath method


Viewing all articles
Browse latest Browse all 4

Trending Articles



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