By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

how to store path of image in the mysql database

P: 52
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.
Expand|Select|Wrap|Line Numbers
  1.  
  2. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  3.     <script>
  4.     function readURL(input)
  5.     {
  6.         if (input.files && input.files[0])
  7.         {
  8.             var reader = new FileReader();
  9.             reader.onload = function (e)
  10.             {
  11.                 $('#example').attr('src', e.target.result).width(150).height(150);
  12.             };
  13.             reader.readAsDataURL(input.files[0]);
  14.         }
  15.     }
  16.     </script>
  17.     <meta charset=utf-8 />
  18.     <!--[if IE]>
  19.     <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  20.     <![endif]-->
  21.  
THIS IS file which i am use.
and on the form
Expand|Select|Wrap|Line Numbers
  1. <img src="images/fileimage.jpg" id="example" style="width: 150px; height: 150px; border: 2px;" />
  2. <input type="file" name="Images" id="Images" onchange="readURL(this);"/>
  3.  
Jun 27 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.