Extend File Upload to utilize mcrypt |
[eluser]dionysus[/eluser]
Is there a way to enable/modify the file upload class to utilize mcrypt to encrypt files that are being uploaded to the system? Not just the filename, but the file itself? thanks!
[eluser]steelaz[/eluser]
You can extend base Upload class to add this function, CodeIgniter has class for encrypting data (defaults to mcrypt) - http://ellislab.com/codeigniter/user-gui...ption.html
[eluser]dionysus[/eluser]
I decided to forgo modifying the upload class. What I did was after the file was uploaded, open the file, encrypt it, and write it out again. Code: $f=file_get_contents(BASE_PATH.$fileFullPath) or die ('no gfc');
[eluser]steelaz[/eluser]
That works too. Also, when you upload a file using CodeIgniter's File Upload class, instead of file_get_contents(BASE_PATH.$fileFullPath), you can do this: Code: $file_data = $this->upload->data(); |
Welcome Guest, Not a member yet? Register Sign In |