Hello, we have a website where we have document upload doc/jpeg/pdf. We can successfully upload it to our DB and then we can view them in the Admin panel. We do however need to create a document download from the binary data that is in the Database. We are using MS SQL and the column containing the data is of "image" type. We use a store procedure to get the information from the data field into a byte array and for all the files everything is working fine except for the PDFs. We are using MVC and C#. Can you give a tip how to save the file?
So far we have tried in the controller:
return File(fileData.Data, System.Net.Mime.MediaTypeNames.Application.Pdf, fileData.Title);
And the fileData.Data is the byte array.
File(fileData.Data, System.Net.Mime.MediaTypeNames.Application.Pdf, fileData.Title +
var libraryManager =
var doc = libraryManager.GetDocuments().FirstOrDefault();
var strm = libraryManager.Download(doc);
 byteArray = ConvertToBytes(strm);
File(byteArray, System.Net.Mime.MediaTypeNames.Application.Pdf, doc.Title +
 ConvertToBytes(Stream stream)
(MemoryStream ms =
It did have the extension for the pdf in the title - the value is "test.pdf".
And didn't solve the problem.