Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Retrieve file BLOB from SQL Server 'Image' field type

by porg (Novice)
on Sep 23, 2015 at 17:02 UTC ( #1142829=note: print w/replies, xml ) Need Help??


in reply to Re: Retrieve file BLOB from SQL Server 'Image' field type
in thread Retrieve file BLOB from SQL Server 'Image' field type

This post http://stackoverflow.com/questions/8309181/perl-module-for-generating-doc-or-docx-document-files seems to imply that there is no way for Perl to write a DOCX, however, would this really matter if the data is stored as a blob? It seems that if all the binary data is already there, then all that should be done to reconstruct the DOCX file would be to dump the binary... right?

  • Comment on Re^2: Retrieve file BLOB from SQL Server 'Image' field type

Replies are listed 'Best First'.
Re^3: Retrieve file BLOB from SQL Server 'Image' field type
by Myrddin Wyllt (Hermit) on Sep 24, 2015 at 13:30 UTC

    Dealing with a general docx file, especially one produced by Word, is difficult because Microsoft don't follow their own specs in all cases. Usually, most specific cases are easier - it's perfectly possible to produce valid, well formatted docx documents using e.g. Template::Toolkit and Archive::Zip, since docx files are just zipped xml at heart.

    I have no knowledge of SQL Server BLOB formats, but it might be worth trying to unzip the .docx file you produce to see if:-

    1. It's a valid zip file.
    2. It contains stuff that looks like xml

    If it doesn't look anything like a zip file, you probably need to do some more processing on the BLOB before writing it to file; if it looks docx-ish, you just have to work out what changes you need to make Word eat it.

      Your recommendation led me to the answer. Thank you for your assistance.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1142829]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-06-12 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (53 votes). Check out past polls.

    Notices?