jQuery Plupload detect encrypted (password protected) files at upload time

StackOverflow https://stackoverflow.com/questions/19354042

  •  30-06-2022
  •  | 
  •  

Вопрос

I'm using jquery.ui.plupload for uploading files.

Is there some way of detecting if a selected file is encrypted/password protected at the time file is selected for uploading?

Это было полезно?

Решение

Is there some way of detecting if a selected file is encrypted/password protected at the time file is selected for uploading ?

Unless, the encrypted files have a dedicated mime type (which I doubt) I'm afraid it would be really difficult :

  • current release of plupload does not give direct access to the file's binary data. (Though I guess it might be possible with beta of plupload 2.0 )
  • encryption / password protection mechanism will depend on the file type. Only dedicated client side readers would be able to read the binary data client side and return the info (from the file or its meta-data). For example, for pdf files, you would need library like pdf.js too try to open the file (not even sure, it would give out the info about encryption/pwd protection, even though it seems to be able to handle the feature)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top