获取图片路径问题

musecangying007 musecangying007 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
前台页面
图片<input type="file" name="path" size="29">

action类
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
FileInputStream in = null;
try {
in = new FileInputStream(this.getPath());
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Blob photo = null;
try {
photo = Hibernate.createBlob(in);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



我在自己的电脑上可以获得图片路径并将图片保存到数据库
但在局域网其它机器上登陆页面并向数据库插入图片时报下面的错误
java.io.FileNotFoundException: D:\My Documents\My Pictures\1024x768.jpg (系统找不到指定的文件。)
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
musecangying007
Web 开发 81,107 成员 341,720 内容