how to store path of image in the mysql database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vishal prada
    New Member
    • Mar 2012
    • 52

    how to store path of image in the mysql database

    hi
    i am using hibernate store the image in database
    but only the image file name is stored.
    and i want to store also path of that image.

    and one more thing
    if i use the same code run on the IE then the database store image path what a want exact.
    but if i use that form of jsp page in mozila firefox then the code only store the image file name in the database.
    Code:
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script>
        function readURL(input)
        {
    	    if (input.files && input.files[0])
    	    {
    		    var reader = new FileReader();
    		    reader.onload = function (e)
    		    {
    		    	$('#example').attr('src', e.target.result).width(150).height(150);
    		    };
    		    reader.readAsDataURL(input.files[0]);
    	    }
        }
        </script>
        <meta charset=utf-8 />
        <!--[if IE]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    THIS IS file which i am use.
    and on the form
    Code:
    <img src="images/fileimage.jpg" id="example" style="width: 150px; height: 150px; border: 2px;" />
    <input type="file" name="Images" id="Images" onchange="readURL(this);"/>
Working...