c# - How to encrypt file name on upload and decrypt on download? -


made asp.net web application receives file using file upload control , encrypts file name on upload.

but when redirect user file_address (so user can download file) don't know how can decrypt file name now? because file (for example .docx file) doesn't have code behind.

so when user downloads file he/she receives file encrypted name!

all files in server have encrypted name , not original name , want know how give files original name when users download files

you can't give user direct link file - rather page first decrypts file, writes appropriate response headers , sends decrypted file response.

like getfile.aspx?encryptedfilename=abcxyz. in init, getfile.aspx loads encrypted file, decrypts it, writes appropriate response headers file, changing mime type whatever file requires, , sending decrypted file instead of web page.

here's example of how zip file. if need more after looking @ this, let me know. how generate , send .zip file user in c# asp.net?


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -