tags:

views:

59

answers:

1

I need to create C# .NET solution to view a .docx file directly from the database without writing on the hard disk. What would be the most feasible approach ?

One option would be to convert the docx file to .mht format and save in the database as blob type. But I could not find a way to directly view it from the database.

Another way is to convert the docx file to .jpg file which can be directly viewed from the database using picturebox control in .NET. The approach taken was to first convert docx to .mdi and then to .tiff format (using Microsoft Image Writer) and the converting to jpeg. But this involves several IO operations which reduces the efficiency and reliability of the solution.

If anyone know ways of improving the above options or any new ideas it would be really appreciated. thanks in advance :)

A: 

You could use an approach like OpenXML Writer (open source) does but instead of opening a file on disk, use a MemoryStream with the data from the database.

JamesMLV