c# - Showing file on browser -


i want have 2 links download , view files

i able download file directly. if user selects view option want open file in browser new tab.

how in asp.net mvc?

for download have below action

public fileresult document()         {             return file(filepath, contenttype,filename);         } 

you can't control whether or not file opens in new tab or existing tab server, controlled setting target attribute on link definition.

you can control whether browser downloads or attempts display file setting content type.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -