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
- <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]-->
and on the form
Expand|Select|Wrap|Line Numbers
- <img src="images/fileimage.jpg" id="example" style="width: 150px; height: 150px; border: 2px;" />
- <input type="file" name="Images" id="Images" onchange="readURL(this);"/>