• 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: 405
  • 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 ?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!