File upload with Javascript without user intervention

时间秒杀一切 提交于 2019-11-28 14:41:17
Nick Craver

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.

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.

There's no direct way to access data on a user's file system within a browser unless you're doing it through an extension. This would be a huge security risk.

If the file can be put into an <input type="file" /> element in Firefox, you can use JavaScript to automatically upload the data to the server without user intervention, but you would need something to initially get the file into the page's memory, not the file system.

Hell no - And for very good reason. You wouldn't want every Tom, Dick and Harry automatically grabbing all your files.

I believe it's the file input that needs user interaction. You can post the form automatically but you can't fill it in.

IMO your best bet is replacing the whole Firefox component with a single Java applet - I'd all but guarantee there's a Java project for PDF signing. Perhaps even Flash or Silverlight as long as you can do what you need with your PDF.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!