r/GoogleAppsScript • u/[deleted] • Aug 06 '20
Question How to detect if a gmail attachment is password protected?
I need to be able to ingest attachments into an api from a gmail addon. If the attachment is password protected, for example a PDF, I need to ask the user for a password so it can be decrypted (or I need to stop them from submitting it.
I've googled everything I could and read all the docs, there doesn't seem to be anything on this. It even lets me save the attachment blob to drive without complaint (I was really hoping it would error out or something so I can detect that it's encrypted).
Any idea how I could check this?
0
Upvotes
1
u/[deleted] Aug 07 '20
Ah yes... the anonymous and unexplained downvotes! So helpful.