Client side (javascript/jQuery) file manipulation before/after upload/download

后端 未结 4 1075
傲寒
傲寒 2021-01-03 12:42

I\'m just sounding things out about this having looked around for a while and drawn a blank. I\'d like to see if this is even possible as so far I can\'t see a way to do it.

相关标签:
4条回答
  • 2021-01-03 13:04

    There is no way to do this using plain Javascript or JQuery due to security restrictions in the browser.

    Your best bet is probably taking a open source Flash based upload component like SWFUpload (Flash can much more or the client side) and adding the encryption routines there in ActionScript. Creating a Java applet or an ActiveX control are also valid options.

    Depending on what kind of encryption we are talking about, there also may exist ready-made components for the job.

    0 讨论(0)
  • 2021-01-03 13:12

    I can't speak to other browsers, but I know this should be possible in Firefox by using the file manipulation api to upload/download files from the user to the client-side code (where they may be manipulated), and standard ajax to upload/download files from the client-side code to the server.

    0 讨论(0)
  • 2021-01-03 13:24

    You can't do this with JavaScript. You can, of course, simply use SSL (e.g., via HTTPS). Dead easy, well-tested, all of that. Otherwise, you'll have to use something non-standard like Flash, Java, or ActiveX.

    0 讨论(0)
  • 2021-01-03 13:30

    The accepted answer is outdated here. It is possible to do this now using HTML5 File API and something like the CryptoJS library.

    0 讨论(0)
提交回复
热议问题