zoukankan      html  css  js  c++  java
  • 浏览器下载代码

    FileObject file = commandFactory.getDownloadFileCommand(fileobjectid).execute(credentialFacade);
                response.setContentType("application/x-download");

                String contentDisposition =  
                        FileUtils.encodeFilename(file.getFilename(), request) ;
                response.setHeader("Content-Disposition", "attachment;filename="+ contentDisposition);
                response.setHeader("Cache-Control", "max-age=1");
                response.setHeader("Pragma", "public");
                response.setHeader("Last-Modified", FastHttpDateFormat.formatDate(file.getCreationdate().getTimeInMillis(), null));
                response.setStatus(HttpServletResponse.SC_OK);
                fileActionFacade.writeFileToOutputStream(response.getOutputStream(), file);
                //20131113
                getAuditTrailFacade().logEvent(credentialFacade.getAccessUser().getDeptName(),credentialFacade.getAccessUser().getLogin(), file.getFile(), AuditTrailFacade.DOWNLOAD, "File downloaded - " + file.getFile().getNodeFullPath(), credentialFacade.getIpAddress());
                return file;

  • 相关阅读:
    Spring IOC
    C++ 内存模型
    C++ 多态
    Java 多态
    Java 自动装箱与自动拆箱
    C++ priority_queue
    多个页面使用到一些名称类的同一个接口,借助vuex实现
    element-ui自定义表单验证
    vue项目中导出excel文件
    数组对象根据某个属性进行排序
  • 原文地址:https://www.cnblogs.com/Nyan-Workflow-FC/p/5054488.html
Copyright © 2011-2022 走看看