上传图片。
第一页:使用<input type="file">选择图片文件,提交给第二页
第二页:将目标文件保存到数据库出现的问题:有的时候完全正常,能够保存到数据库,但有的时候会报错,如:java.io.FileNotFoundException: C:\2003918137719402.jpg (系统找不到指定的路径。)第二页的部分代码:
String photo_path = request.getParameter("filepath");
String fpath=photo_path.replaceFirst("\\\\","\\\\\\\\");
……
       oracle.sql.BLOB osb = (oracle.sql.BLOB) rs.getBlob("photo");
       OutputStream outStream = osb.getBinaryOutputStream();
       File file = new File(fpath);
       InputStream inStream = new FileInputStream(file);
       byte[] b = new byte[osb.getBufferSize()];
       int len = 0;
       while ( (len = inStream.read(b)) != -1) {
          outStream.write(b, 0, len);
       }
       inStream.close();
       outStream.flush();
       outStream.close();请问错误应该在哪呢?