By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,886 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,886 IT Pros & Developers. It's quick & easy.

Open binary file directly from BLOB

P: n/a
Hi,

Can someone suggest the best technique / method of opening a Word ( or any
other ) Document from an SQL BLOB ?

I have the process of saving and retrieveing the file from an SQL Binary
field working fine, but the user 'saves' the file from the Binary field to a
binary disk file and can then open it. It would be better for them to be
able to just open the file directly for viewing etc. I can 'trigger' a load
for the file myself, but Im sure there must be a 'slick' method using some
sort of 'memory' files, without needing to explicitly write the file to
disk first ?

One Issue I can forsee is determining the application required to open the
file. Also what would happen if the user modified and tried to save it ? Or
do you just use a 'viewer' / view only mode ?

Is saving it to disk first actually the required technique ?

Thanks in advance.

Jon
Aug 7 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jon,

It pretty much is. You could probably load a new Word document, and
then query it for the IPersistMemory interface. If it supports that, then
you can feed the contents into Word from memory. However, you would have to
manage when it is saved (since there is no option in Word to save the file
to memory, only to disk), calling the Save method on the IPersistMemory
interface yourself when you wanted to commit the contents back to memory.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bishman" <jo*************@btinternet.comwrote in message
news:uH**************@TK2MSFTNGP04.phx.gbl...
Hi,

Can someone suggest the best technique / method of opening a Word ( or any
other ) Document from an SQL BLOB ?

I have the process of saving and retrieveing the file from an SQL Binary
field working fine, but the user 'saves' the file from the Binary field to
a binary disk file and can then open it. It would be better for them to be
able to just open the file directly for viewing etc. I can 'trigger' a
load for the file myself, but Im sure there must be a 'slick' method using
some sort of 'memory' files, without needing to explicitly write the file
to disk first ?

One Issue I can forsee is determining the application required to open the
file. Also what would happen if the user modified and tried to save it ?
Or do you just use a 'viewer' / view only mode ?

Is saving it to disk first actually the required technique ?

Thanks in advance.

Jon

Aug 7 '06 #2

P: n/a
Thanks ( again ) Nicholas

Shame there is nothing 'slicker' but then its good in one way as its less
for me to code !!

Cheers for the response

Jon
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP04.phx.gbl...
Jon,

It pretty much is. You could probably load a new Word document, and
then query it for the IPersistMemory interface. If it supports that, then
you can feed the contents into Word from memory. However, you would have
to manage when it is saved (since there is no option in Word to save the
file to memory, only to disk), calling the Save method on the
IPersistMemory interface yourself when you wanted to commit the contents
back to memory.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bishman" <jo*************@btinternet.comwrote in message
news:uH**************@TK2MSFTNGP04.phx.gbl...
>Hi,

Can someone suggest the best technique / method of opening a Word ( or
any other ) Document from an SQL BLOB ?

I have the process of saving and retrieveing the file from an SQL Binary
field working fine, but the user 'saves' the file from the Binary field
to a binary disk file and can then open it. It would be better for them
to be able to just open the file directly for viewing etc. I can
'trigger' a load for the file myself, but Im sure there must be a 'slick'
method using some sort of 'memory' files, without needing to explicitly
write the file to disk first ?

One Issue I can forsee is determining the application required to open
the file. Also what would happen if the user modified and tried to save
it ? Or do you just use a 'viewer' / view only mode ?

Is saving it to disk first actually the required technique ?

Thanks in advance.

Jon


Aug 7 '06 #3

P: n/a
Bishman,

Maybe it will be easy to handle if you leave those Word files to the OS and
keep a link in DB.

chanmm

"Bishman" <jo*************@btinternet.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
Thanks ( again ) Nicholas

Shame there is nothing 'slicker' but then its good in one way as its less
for me to code !!

Cheers for the response

Jon
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:%2****************@TK2MSFTNGP04.phx.gbl...
>Jon,

It pretty much is. You could probably load a new Word document, and
then query it for the IPersistMemory interface. If it supports that,
then you can feed the contents into Word from memory. However, you would
have to manage when it is saved (since there is no option in Word to save
the file to memory, only to disk), calling the Save method on the
IPersistMemory interface yourself when you wanted to commit the contents
back to memory.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bishman" <jo*************@btinternet.comwrote in message
news:uH**************@TK2MSFTNGP04.phx.gbl...
>>Hi,

Can someone suggest the best technique / method of opening a Word ( or
any other ) Document from an SQL BLOB ?

I have the process of saving and retrieveing the file from an SQL Binary
field working fine, but the user 'saves' the file from the Binary field
to a binary disk file and can then open it. It would be better for them
to be able to just open the file directly for viewing etc. I can
'trigger' a load for the file myself, but Im sure there must be a
'slick' method using some sort of 'memory' files, without needing to
explicitly write the file to disk first ?

One Issue I can forsee is determining the application required to open
the file. Also what would happen if the user modified and tried to save
it ? Or do you just use a 'viewer' / view only mode ?

Is saving it to disk first actually the required technique ?

Thanks in advance.

Jon



Aug 8 '06 #4

P: n/a
Yeah, I have seen other people advise this as well and its a fair
point.....to which I dont really have a particuarly strong response other
than the DB gets treated with a degree of respect from the backup and
security point of view, and it does provide that almost 'physical ' link
between the rest of the data associated with the BLOB and the BLOB itself.
"chanmm" <ch*****@hotmail.comwrote in message
news:eH**************@TK2MSFTNGP06.phx.gbl...
Bishman,

Maybe it will be easy to handle if you leave those Word files to the OS
and keep a link in DB.

chanmm

"Bishman" <jo*************@btinternet.comwrote in message
news:%2***************@TK2MSFTNGP06.phx.gbl...
>Thanks ( again ) Nicholas

Shame there is nothing 'slicker' but then its good in one way as its less
for me to code !!

Cheers for the response

Jon
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in message news:%2****************@TK2MSFTNGP04.phx.gbl...
>>Jon,

It pretty much is. You could probably load a new Word document, and
then query it for the IPersistMemory interface. If it supports that,
then you can feed the contents into Word from memory. However, you
would have to manage when it is saved (since there is no option in Word
to save the file to memory, only to disk), calling the Save method on
the IPersistMemory interface yourself when you wanted to commit the
contents back to memory.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bishman" <jo*************@btinternet.comwrote in message
news:uH**************@TK2MSFTNGP04.phx.gbl...
Hi,

Can someone suggest the best technique / method of opening a Word ( or
any other ) Document from an SQL BLOB ?

I have the process of saving and retrieveing the file from an SQL
Binary field working fine, but the user 'saves' the file from the
Binary field to a binary disk file and can then open it. It would be
better for them to be able to just open the file directly for viewing
etc. I can 'trigger' a load for the file myself, but Im sure there must
be a 'slick' method using some sort of 'memory' files, without needing
to explicitly write the file to disk first ?

One Issue I can forsee is determining the application required to open
the file. Also what would happen if the user modified and tried to save
it ? Or do you just use a 'viewer' / view only mode ?

Is saving it to disk first actually the required technique ?

Thanks in advance.

Jon



Aug 8 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.