Is possible encrypt files from request post? How?
files = request.FILES[files]
gpg = gnupg.GPG(homedir='/home/XXXX/.gnupg')
gpg.encrypt(files) <-- This do exception
Exception:
'InMemoryUploadedFile' object has no attribute 'encode'
As said by the documentation you should pass a string to encrypt(), not a file. encrypt() is certainly trying to get the encoded string by trying to call .encode() on the argument.
You can find an example of encrypting a file here.