0
如何获取所选文件的完整路径。 比如我选择logo.png 它应该得到c:\user\admin\desktop\logo.png
获取所选(浏览)文件的完整路径jsp web
String im = request.getParameter("image");
InputStream inputStream = new FileInputStream(new File(im));
pstmt=con.prepareStatement("Insert into items(image) values(?)");
pstmt.setBlob(1, inputStream);
此代码插入到datbase它显示这个以下错误
java.io.FileNotFoundException: logo.png (The system cannot find the file specified)
(尝试一切没有运气)
如果您正在尝试使用''''''做文件上传? – 2014-11-24 03:50:19
是的,我试过使用这个问题是当我选择浏览文件,它只显示文件名不完整的路径 – user2605953 2014-11-24 04:08:07