在angularjs和express.js之间下载工作
发布时间:2020-12-17 07:57:11 所属栏目:安全 来源:网络整理
导读:我可以获取我请求的文件的原始数据,但我无法让浏览器向用户提供文件.我需要使用iframe吗? //Client code download_file: function (path,callback) { $http.post('/download/client_file',{path:path}). success(function(data,status,headers,config) { co
我可以获取我请求的文件的原始数据,但我无法让浏览器向用户提供文件.我需要使用iframe吗?
//Client code download_file: function (path,callback) { $http.post('/download/client_file',{path:path}). success(function(data,status,headers,config) { console.log(data); //this contains the raw data of the res.download //from the server. }); } //server code res.download(file); // the path is proper
我在我的服务文件中使用下面的代码来下载项目,它运行得很好.我从
http://filamentgroup.com/lab/jquery_plugin_for_requesting_ajax_like_file_downloads/开始
$('<form action="'+ url +'" method="'+ ('post') +'">'+inputs+'</form>') .appendTo('body').submit().remove(); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux – docker docker.service的作业失败,因为控制进程
- 如何在Angular2中正确使用依赖注入(DI)?
- 使用Docker Hub和私有映像的Kubernetes PullImageError
- twitter-bootstrap-3 – Bootstrap 3 – 固定响应式Navbar容
- twitter-bootstrap – 编辑引导程序模板,更改jarvisWidget标
- CXF中服务发布与访问方式
- PB12.0 开发 webService 注意事项
- Angular ng-class样式切换
- Axis1.4开发webService中遇到的问题及解决方案
- scala – 端到端的反应流式RESTful服务(通过HTTP进行背压)