File upload with Javascript without user intervention(使用 Javascript 上传文件,无需用户干预)
问题描述
我有一个用于 PDF 签名的 Firefox 组件,我通过 Javascript 调用它.问题是该组件将签名的 PDF 输出为用户文件系统上的文件 - 无法获取字节 []、流或类似内容.
I have a Firefox component for PDF signing that I invoke via Javascript. The problem is that this component outputs the signed PDF as a file on the user's filesystem - there is no way to get a byte[], stream or similar.
我需要将此签名的 PDF 文件发回服务器.是否可以在纯 Javascript 中做到这一点,而无需额外的 Firefox 组件?
I need to post this signed PDF file back to the server. Is it possible to do this in plain Javascript, without additional Firefox components?
推荐答案
你不能在没有干预的情况下做到这一点,这将是一个巨大的安全漏洞.想想访问一个网页,它能够在您不做任何事情的情况下抓取和上传您的任何文件......您可以看到这将如何被滥用真的快.
You can't do this without under intervention, this would he a huge security hole. Think about visiting a webpage and it being able to grab and upload any of your files without you doing a thing...you can see how this would be abused really fast.
您也许可以使用 Firefox 扩展来做到这一点,我不确定它施加的安全限制(尽管如果它也不允许这样做我不会感到惊讶),但 JavaScript 在这里不是一个选项.
You might be able to do this with a Firefox extension, I'm not sure of the security limitations it imposes (though I wouldn't be surprised if it disallowed this as well), but JavaScript would not be an option here.
这篇关于使用 Javascript 上传文件,无需用户干预的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Javascript 上传文件,无需用户干预


- 失败的 Canvas 360 jquery 插件 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Flexslider 箭头未正确显示 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01