cancel
Showing results for 
Search instead for 
Did you mean: 

Open/Display File from database

Former Member
0 Kudos

I am having problems displaying documents (pictures, text files, xls files etc.) that I have uploaded into a varbinary(max) sql server column.

I've been able to display images and text files, but only if I use a bls calling a image loader pointing to the file stored on our MII server. 


var strFile = "/XMII/Runner?Transaction=CustomerComplaintTracking/GetAttachments2-b&COMPLAINTNUM=0000000031" + "&OutputParameter=OUT&Content-type=image/pjpeg";

fileWindow = window.open(strFile,'fileWindow','width=800, height=600, top=100, left=300,resizable=1')

My question is how to I display images or open documents that have been stored in a varbinary(max) sql column without linking to a file stored on the MII server. Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Lucas,

one way to read a var<sthg>(max) is to read them chunck by chunck through a procedure and to return the concatenated VARCHAR(MAX). you would have to use a Substring function.

The re-created and aggregated content is returned in one go through the query template.

But if you intend to save document in the database, then save them directly in the web folder (file sabe destination db:// or web://). The limitation here is that you should not have too much of them (10M-100M sort of Range).

If you have more than that you are probably better off storing them on the file system, shared drive, ftp etc... depending on your use case.

Cheers,

Arnaud