Storing documents in MySQL RRS feed

  • Question

  • User-973319413 posted

    Hi all,

    I need to store word,pdf,notepad,rtf documents in MySQL database.

    Can someone send me some code snippets to refer.

    Thanks and Regards


    Wednesday, November 16, 2011 2:15 AM


All replies

  • User-1179452826 posted

    You could store them as a byte[] but it's almost always better to store them in the file system and just storing the path to the file in the database.

    Wednesday, November 16, 2011 4:29 AM
  • User-973319413 posted


    Yes it is not a good idea to store documents in databases..But my requirement is to do that way.

    Is there some code snippet available



    Wednesday, November 16, 2011 4:44 AM
  • User-1179452826 posted

    Second result on google:


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 16, 2011 4:46 AM