文件服务器端创建,显示问题总结
2014-09-18 10:22
197 查看
文件创建方法备份:
二种
tomcat部署路径:
File savefile = new File(new File(realpath), imageFileName); if (!savefile.getParentFile().exists()) savefile.getParentFile().mkdirs(); FileUtils.copyFile(image, savefile);
二种
System.out.println(getSavePath()); fos = new FileOutputStream(getSavePath() + "\\" + getImageFileName()); // 建立文件上传流 fis = new FileInputStream(getImage()); byte[] buffer = new byte[1024]; int len = 0; while ((len = fis.read(buffer)) > 0) { fos.write(buffer, 0, len); }
tomcat部署路径:
<!-- ${pageContext.request.contextPath} tomcat部署路径, 如:D:\apache-tomcat-6.0.18\webapps\struts2_upload\ --> <img src="${pageContext.request.contextPath}/<s:property value="'images/'+imageFileName"/>">
相关文章推荐
- 转 “automation服务器不能创建对象”的问题的解决方案总结大全
- javascript操作写入txt文件及消息: Automation 服务器不能创建对象问题
- 在服务器上创建.aliyun-mns.properties文件,用命令ls却没有显示
- 转 “automation服务器不能创建对象”的问题的解决方案总结大全
- flv的mime类型(.flv文件传到服务器上就无法显示问题解决)
- PowerDesigner16.5快速入门显示,注释comment配置方法,以及创建sql文件过程中需要注意的一些问题
- 记录 Linux 服务器磁盘空间还有但是服务创建写入文件的问题 解决
- Log4j创建日志服务器 解决集群日志问题及话单文件
- 怎样取消文件和SVN服务器的关联? 绿勾显示与不显示的问题
- Web 在线文件管理器学习笔记与总结(2)显示文件列表(名称,类型,大小,可读,可写,可执行,创建时间,修改时间,访问时间)
- 解决lamp创建后xftp连接服务器无法创建文件的问题
- "automation服务器不能创建对象”的问题的解决方案总结大全
- Log4j创建日志服务器 解决集群日志问题及话单文件
- JAVA问题总结之27--创建100个文件
- 工作总结 1 sql写法 insert into select from 2 vs中 obj文件和bin文件 3 npoi 模板copy CopySheet 最好先全部Copy完后 再根据生成sheet写数据 4 sheet.CopyRow(rowsindex, rowsindex + x); 5 npoi 复制模板如果出现单元格显示问题
- nodejs基础(一)创建服务器,分发路由,读文件,写文件,读取图片,图文一起显示
- PowerDesigner16.5快速入门显示,注释comment配置方法,以及创建sql文件过程中需要注意的一些问题
- eclipse中创建tomcat服务器问题总结
- 有关oracle遇到日期显示问题,导入导出,安装,卸载,修改listener配置文件,创建用户和表空间等的部分问题.
- 转 “automation服务器不能创建对象”的问题的解决方案总结大全