首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

关于ice:fileinput的有关问题

2012-10-17 
关于ice:fileinput的问题问题已经解决,但仍不知道原因。通过设置绝对路径,使得上传文件得以实现: context-

关于ice:fileinput的问题
问题已经解决,但仍不知道原因。通过设置绝对路径,使得上传文件得以实现:

 <context-param>         <param-name>com.icesoft.faces.uploadDirectory</param-name>         <param-value>C:\Uploads</param-value>     </context-param>     <context-param>         <param-name>com.icesoft.faces.uploadDirectoryAbsolute</param-name>         <param-value>true</param-value>     </context-param>  


以及:
 public void essaiDeplacer(ActionEvent event){ String id = ((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false)).getId();  InputFile inputFile =(InputFile) event.getSource();       //file has been saved        if (inputFile.getStatus() == InputFile.SAVED) {             String fileName = inputFile.getFileInfo().getFileName();             System.err.println("filename = "+fileName);             File source = new File("c:\\Uploads\"+id+"\"+fileName);     File destination = new File("c:\\Uploads\"+fileName);     source.renameTo(destination);        } }


引自:http://www.icefaces.org/JForum/posts/list/8293.page

热点排行