In my web application:

I want to store a .Doc file(word file) in database
and then retrieve it and display it in the same format in a web page.

I am using ASP.NET 0.2 and SQL 2005.

thnx.

Recommended Answers

All 5 Replies

will you be looking to edit this document online then update what is in the database ?

also why bother storing this in a database and not just reference a local file ?

better to store this in a database because that way you wont accidentally delete the file from disk, making the link broken....

I have been working on this, have the BLOB in the database, working on getting it out again now

I just got code working there to get a file back out based on an ID, but its returning the wrong file for that ID :S lol

I had stored the word file in the database but when retrieving it from the database,
it opens in MS word not in a web page.

I want to display it in a web page in the same format.

thnx

Im not too sure then, all I need mine to do is give the user the option to open, save or cancel the download.....although at the minute, word is unable to open the file, it cant recognise the file format

you need to buffer the file to the page and add the right header for them to open it and not download it to there comp then open it.

you need to add the "Content-Type" header with a value of "application/vnd.ms-word"

this will open your document in the browser window.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.