据我所知,除非首先上传到服务器,然后重新下载到用户,否则无法在Web应用程序中访问用户计算机上的文件内容,除非使用某种插件。 (Flash等)理想情况下,用户可以将文件直接上传到localstorage,然后脚本就有机会处理/显示/验证/过滤而无需用户等待上传。
As far as I can tell, it is impossible to access the content of files on the user's computer in a web application without first uploading to the server, then re-downloading to user, unless some sort of plug-in is used. (Flash, etc.) Ideally, the user would upload the file directly to localstorage and then scripts would have a chance to process/display/validate/filter without the user having to wait on an upload.
在即将推出的网络标准中是否有任何功能,如html5,这将允许这个?如果没有,为什么没有努力使这成为可能,我怎么能解决它而不会卡住插件?
Are there any features in upcoming web standards such as html5 that will allow this? If not, why has there been no effort to make this possible, and how can I work around it without getting stuck with plugins?
编辑: 不要以为我想让JavaScript在没有任何用户干预的情况下访问硬盘上的任意文件。 我们已经能够提示用户输入文件并上传它,我只想提示用户将文件加载到浏览器的内存中。 我只希望HTML5支持你已经可以用Flash和Java小程序做的事情。
推荐答案不是文件API( www.w3/TR/FileAPI / )这样做?
Doesn't the File API ( www.w3/TR/FileAPI/ ) do that ?
它在Firefox 3.6中实现(参见 developer.mozilla/en/DOM/FileReader 和 developer.mozilla/en/Using_files_from_web_applications )
It's implemented in Firefox 3.6 (see developer.mozilla/en/DOM/FileReader and developer.mozilla/en/Using_files_from_web_applications )
根据 code.google/events/io/2010/sessions/html5-status- chrome.html支持chrome.html。
According to code.google/events/io/2010/sessions/html5-status-chrome.html it is supported in chrome.
更多推荐
无需上传即可访问Web应用程序中的文件内容
发布评论