To save files with PDF extension in the database do you need to do the conversion to base 64 ? Or would you have some other way to save this type and your recovery for viewing?
The code I have below, does the image conversion to base 64 , where image recovery is properly handled. When saving a PDF file it converts the same, but in the recovery of the file looks like this:
using(varstream=newMemoryStream()){clientesFotos.File.CopyTo(stream);System.IO.File.WriteAllBytes(path,stream.ToArray());clientesFotos.DocumentoString=Convert.ToBase64String(stream.ToArray());stream.Dispose();stream.Close();}
ReturnofConvertedFilesfromBase64
functionexibirDocumentos(img){//$("#overlay").show();
$("#imagem").attr("src", "data:image/jpeg;base64," + document.getElementById(img).value);
}