To send pdf files (or any other file type) to the browser, I’ve seen examples that use the FileResult class or a custom Action Result.
Is there an advantage of using one over the other? Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT Original reply removed.
I’m not sure if the exist file result allows to you modify the content disposition, I believe it forces the content disposition of “attachment”. If you want to use a different disposition, I’d implement a custom Action Filter:
That is one I’ve used previously, because I pass the actual byte[] data of the file.