Opening the BLOBS data types from SQL with the associated programs

  • Dear All,

    I am working on an application to store binary file data in a DB and hope fully I can retrieve this data and open file with the associated program, Is this possible.

    For example If I am storing WORD documents within a database table and I wanted to retrieved the data from the database and open the document without saving the file first to the drive but dynamiclly using the blolb object as the file data.

    If you need more clarification on this please do not hesitate to reply to this thread.

     

    Kindest Regards,

     

    Nimish Pankhania

    Software Engineer.

  • This was removed by the editor as SPAM

  • You would handle this within your application. As far as SQL Server is concerned, you are just going to store binary data in a varbinary column.  You will want to also have columns with filename and/or file type of the data, so that when you when your application reconstructs the document, it knows what it has.  But the storing of the document and rebuilding the document will be done by the application.

    Whether you can open a Word document without creating it as a file: I don't know that you can do that.  I believe that you will need to create the file for Word to open it, unless there is some feature in Word Com objects that will let your application feed it the document without opening a file.  I am not aware of anything like that, but perhaps Word 11 (2003) or Word 12 have that.

    Hope this helps.



    Mark

  • Thanks Mark for the information much appreciated.

    To add to this solution I found on the web a way to push the document out to a browser window using

    response.binarywrite <field name/Variable Name>

    I have yet to test this solution but I have seen examples on development web sites. 

    Thank you again  Mark and spleak to you soon.

    Regards,

    Nimish

  • Yes, that is how to send a file to the web site user.  Also, you will want to make sure that you set the Response.ContentType before you do the BinaryWrite, so that the HTTP header is set correctly for the user to know what to do with the file.  In your case, you want to have:

    Response.ContentType = "application/msword"
    Response.BinaryWrite arrayByte

    Hope this helps



    Mark

  • if for example,they are word documents that you want to upload to a website, you can store them in a folder and create a reference in the database. this would save on the database size. i think.


    Everything you can imagine is real.

  • The folder structure that the company currently have would be too confusing to manage outside the database.

    You are right that the database size will be huge but space is not an issue for the company and also this would allow an element of a one-stop searching interface to be developed when taking into consideration the FULL text searching capabilities of BLOBS from within  SQL 2005.  Also the added advantage would be a form of revision control where by documents saved on top of each other can be retraced.

    Thank you all again...

    Nimish..

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply