• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Save Image into Mysql database

 
Dev Anand
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm using the following code to insert image into Mysql database. It works fine in Internet Explorer. But it is not working in the remaining browsers like Mozilla n Opera, throwing file name not found exception.

How to solve this problem to work fine in all the browsers?
------------code---------------

imgUrl=request.getParameter("file_image")!=null ? request.getParameter("file_image"):"";
FileInputStream in =null;
int len=0;
try
{
in= new FileInputStream(imgUrl);
len=in.available();
}
catch(Exception e)
{
System.out.println(e);
}
pstmt.setBinaryStream(4, fis, len);

----------------------------code End--------------------------
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to be a problem with the jsp, can you post some code here please ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic