Opening byte [] as a file without actually saving it as a file at the beginning

What is the best way to open a Word file that has been saved as byte [] in the database?

I have to store some documents in an Access database - Word, 2003 and higher files - on an application that runs strictly on the CD. Unfortunately, they must be in the database and cannot be stored in folders. I store them as an OLE object, and I can read and write them just fine, like a byte [].

However, I do not know how best to open these documents in Word. Right now, I'm using FileStream to recreate the file somewhere, and then shoot System.Diagnostics.Process.Start(filename)to open it. This will be used on government computers, which sometimes may have some funky security rules, so I don’t know if this is the best way.

Is it possible to open a file previously saved as a byte [] without using any intermediary file stored on the hard drive? I know that they will have at least Word 2003, so I am open to using Word.

Thanks for any input!

+3
source share
1 answer

, Word , , , RAMDisk - .

GetTempFile() Word ?

  string fullPathToATempFile = System.IO.Path.GetTempFileName();
// or
  string tempDirPath = System.IO.Path.GetTempPath();
+6

Source: https://habr.com/ru/post/1753613/


All Articles