Importing PDF's into a database

Hello,

I have imported some PDF's into a database as instructed by my boss, but when I go to view them in a web browser (using a coldfusion script) it tells me the files are corrupt. Everywhere I have looked online states to import the PDF's as a Varbinary data type which is what I have done. So why are the files corrupting? They weren't corrupted before I imported them.

July 21st, 2015 9:39am

Hi Stacey27,

How do you write your script to view PDF files from database? If you use programming codes to display PDF files from database in web browser, I would recommend you post the question in programming relevant forums. It is appropriate and more experts will assist you.

In addition, please note that when saving PDF file in SQL Server database, we need to convert the PDF file into a byte array and then put it into the varbinary field.

There are also some examples in the following blog for your reference.

Retrieve and display PDF Files from database in browser in ASP.Net
http://www.aspsnippets.com/Articles/Retrieve-and-display-PDF-Files-from-database-in-browser-in-ASPNet.aspx

Save and Read PDF File Using SQL Server and C#
http://www.c-sharpcorner.com/UploadFile/013102/save-and-read-pdf-file-using-sql-server-and-C-Sharp/



Thanks,
Lydia

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 10:35pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics