Django file upload and python Encryption How change file name

144 views
Skip to first unread message

Harold Gomez

unread,
Apr 3, 2016, 12:29:34 AM4/3/16
to Django users
please help me
I have a django file upload sytem
a python file encryption code
the file encryption is done by a function called encrypt_file
which will encrypt the file from

path/filename.extention

to

path/filename.enc

the filename.enc is fixed
and only one file is created
how can i make it so that it will change after  and i can have multiple files on each file upload


MEDIA_FILE = os.path.join(BASE_DIR, 'media/fi1.enc' )
is how i made the path

            from_path    to_path            secret key
encrypt_file(request.FILES['docfile'], MEDIA_FILE, '8W;>i^H0qi|J&$coR5MFpR*Vn')

how can fi1 be a variable

OR

How to solve my problem(i.e any other best methods)
webupload.tar.gz

Harold Gomez

unread,
Apr 3, 2016, 12:46:45 AM4/3/16
to Django users
/myapp should be given at url filed
please help

Reply all
Reply to author
Forward
0 new messages