![]() |
Saving document into database
I'm looking for help on how to save .doc and .pdf documents into a database, and then after that, be able to retrieve the text into a textbox.
I've read around, and saw it can be done by converting the document into a binary data type, but I have no idea how this can be done. I'm using ASP with C# and SQL Server 2005. Please Help |
Re: Saving document into database
Why don't you just store the files on the server and put in the path in the database?
|
Re: Saving document into database
Then if the file should get moved?
|
Re: Saving document into database
If the file gets moved then you either make a program to move it that will also update the database or you update the database on your own.
|
Re: Saving document into database
Quote:
What you need to do is write a script to insert a text file into a column. However, there are two changes you need to make apart from that routine process. 1) Make that column type "BINARY". :
BINARY(M) 2) When you are reading in the PDF document, make sure your read handle is opened with the "rb" (read binary) format, rather than the typical "r" or "rt" (read text) format. Getting back on track, you said you want to retrieve the document from the database, and display it in a textbox. If you're using a textbox to display the output, then you don't want the binary. It seems you just want the text. You might need to find some .doc and .pdf libraries that could do the processing and plaintext fetching for you. But converting a fully formatted document with pictures and a layout, into simple plaintext, is a very difficult task. |
| All times are GMT -5. The time now is 12:51 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC