c# - How do I link to downloadable files in ASP.NET MVC? -
I am new to ASP.NET MVC and I'am downloadable files (.zip, .mp3, , e.t.c).
I have the following views: ProductName
for the map: http: // domain / ProductName
I have a . ZIP
file for URL http: //domain/ProductName/Product.zip
question
Mapped> Where can I place this .zip
file in the MVC folder structure?
How do I add this .zip
file to MVC? Is it such a URL? * Way?
You can use the FilePathResult or Controller.File method.
Protected internal virtual file path file (string filename, string content type, string file download downdam) {new file path result (filename, content type) {fileDownloadName = fileDownloadName}; }
Sample code behavior method.
Download Public Actions () {Return file (filename, content type, downloadfilename); }
Hope this code.
Comments
Post a Comment