Forum Moderators: open

Message Too Old, No Replies

uploading word document into database

uploading word.doc

         

GueillaGrowers

3:55 pm on Mar 25, 2004 (gmt 0)

10+ Year Member



I want to know how i can upload a word.doc into my database. The form i use works but i get this message in my browser: "Disallowed implicit conversion from data type varchar to data type binary, table 'ewebs.dbo.blub', column 'upload'. Use the CONVERT function to run this query.""

Any help please!

Xoc

8:17 pm on Mar 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld.

If you are actually storing the word document in the database, you need to use the data type binary, not nvarchar.

MozMan

8:56 pm on Mar 31, 2004 (gmt 0)

10+ Year Member



Hey GG-

I have a question: is it necessary for you to store the native file (in this case .doc) in the database directly?

If not, you may want to consider storing them to disk and putting only a reference to the location in the database. This can save you a lot of db overhead.

Just a thought.

-Moz

GueillaGrowers

9:33 am on Apr 9, 2004 (gmt 0)

10+ Year Member



Tnx everyone,

It's possible now to upload this document on the fly.

I can also retrieve it back.

It works.

webboy1

9:05 am on Apr 10, 2004 (gmt 0)

10+ Year Member



I Know you now have it working, but i just thought i would add in my bit.

I agree with Mozman. I have recently needed a to create a script that allows me to upload docs to the server. I looked through both options i.e. doc to DB, and Doc to server with a reference in DB.

I decided on the later. I found a very simple upload script and edited it, and added in all the DB functions, and it works a treat.

I have heard from other people that docs (or images) sent straight to the DB in to be stored in Binaru can cause quite a headache in the long run.

Glad you got it working though!

Webboy