I have an Attachments table in the DB where there is a filename and filedata that is in varbinary format. On the c# end, I need to convert this data to string and depending on the MIMEType, create a downloadable .xls/.pdf file. What is the best way to do this? Can I use ActionLink to do this? I’m new to using MVC and do not have an idea of the best approach for this. Any suggestions would be appreciated.
Share
I would bypass converting to a string and just worry about returning the correct mime type.
Check out this question:
byte[] to File Type in MVC 3
You just need to determine the content type to set the mime type.