将文件保存在客户端系统上 [英] save file on client system

查看:69
本文介绍了将文件保存在客户端系统上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我具有下载选项,该选项可以从该jsp下载数据并以所需格式保存在服务器系统上.我需要与在客户端系统上保存文件的功能相同的代码.

In my application i have download option which downloads the data from that jsp and gets saved on server system in required format.i require code for the same functionality that save file on client system.

推荐答案

如果我正确解释了该问题,则需要从正在运行的脚本向文件输出一些信息.调试javascript时,我会一直这样做:

函数myFunction(obj){

var = f =新文件("C:\\ users \\ me \\ op \\ etc \\ here.txt")
f.open(''a'')

for(var i = obj.blah.length-1; 0< = i; i-){
试试{...
if(... {


var dbg =串行输出:" + obj.blah [i] .name;
f.writeln(dbg);

}
}
抓住(e){
}
}

f.close();
}
If I''m interpreting the question correctly, you want some output to a file from a running script. I do this all the time when I''m debugging javascripts:

function myFunction(obj){

var = f = new File("C:\\users\\me\\op\\etc\\here.txt")
f.open(''a'')

for(var i = obj.blah.length-1; 0<=i;i--){
try{ ...
if( ...{


var dbg = "serial output: " + obj.blah[i].name;
f.writeln(dbg);

}
}
catch(e){
}
}

f.close();
}


这篇关于将文件保存在客户端系统上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆