如何使用 javascript/VBScript 读取 excel 2007 文件 (xlsx)
我想在客户端读取用户上传的文件,然后对其进行处理,而不是在服务器端进行处理。是否可以在客户端使用 javascript 读取文件并进行操作。是否可以使用 VBScript 来实现此目的
I want to read the file uploaded by users on the client side and then do processing on them, instead of doing it on server-side. Is it possible read files and do manipulation using javascript on client side. Is it possible to use VBScript for this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在浏览器中做了一些非常简单的 xlsx 解析。请参阅https://gist.github.com/3375836。请在 http://jsfiddle.net/fAKGA/2 尝试一下。为了方便,复制到这里:
I've done some very simple xlsx parsing in the browser. See https://gist.github.com/3375836. Try it out at http://jsfiddle.net/fAKGA/2. Copied here for convenience:
浏览器应该使访问本地文件变得不可能(我们都应该对此感到高兴)。但用户可以安装一个 .HTA,它可以完成本地/客户端计算机上的所有操作。
The browser should make it impossible to access local files (and we all should be happy about that). But the user could install a .HTA that can do short of everything on the local/client computer.
简而言之,不行。javascript 无法访问文件系统,这将是一个主要的安全威胁/攻击向量。
In short, No. The is no way for javascript to access the filesystem, this would be a major security threat/attack vector.
绝对不是。出于安全目的,这必须在服务器端完成。无论如何,我想不出有什么理由让你不想这样做。
Absolutely not. For security purposes, this must be done server side. I can't think of single reason you wouldn't want to do it that way anyway.