Skip to main content
Inspiring
August 4, 2011
Question

Retrieve Binary File stored in DB

  • August 4, 2011
  • 1 reply
  • 676 views

Hello,

I am able to store PDF, MS word, MS Excel files as Binary files to MS Sql Server 2008.

How do I retrive these files on the view page.

I need to hyperlink the files, so when User clicks it opens or prompts for download.

    This topic has been closed for replies.

    1 reply

    Inspiring
    August 5, 2011

    Well... they hyperlink should go to a CFM file which queries the DB for the file content then outptus that with the correct MIME type set for the file in question.

    However getting CF to do this is a really inefficient approach to such things: you're gonna want to keep an eye on what percentage of your CF threads get tied up serving files like that.

    Is there any reason you can't serve the files from the file system, rather than from the DB via CF?

    --

    Adam

    umuayoAuthor
    Inspiring
    August 5, 2011

    I know what you mean, but you have to do what the client wants. As of now they want all info to be stored on the DB sever.....images, files and data etc