File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 11
22# 🚀Simple Laravel Encrypt Upload File
3- [ ![ GitHub license] ( https://img.shields.io/github/license/irfaardy/raja-ongkir?style=flat-square )] ( https://github.com/irfaardy/raja-ongkir/blob/master/LICENSE ) [ ![ Support me] ( https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square )] ( https://www.buymeacoffee.com/OBaAofN )
3+ [ ![ GitHub license] ( https://img.shields.io/github/license/irfaardy/encrypt-file-laravel?style=flat-square )] ( https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE ) [ ![ Support me] ( https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square )] ( https://www.buymeacoffee.com/OBaAofN )
4+
5+ <p >The Simple Laravel Encrypt Upload File uses the default encryption of Laravel which is implemented in upload file.<p >
46<h3 >🛠️ Installation with Composer </h3 >
57
6- composer require irfa/raja-ongkir
8+ composer require irfa/encrypt-file-laravel
79
810> You can get Composer [ here] ( https://getcomposer.org/download/ )
911
4547
4648 namespace App\Http\Controllers;
4749
50+ use Filesafe;
4851 use Illuminate\Http\Request;
4952 use App\Http\Controllers\Controller;
5053
5558 {
5659 $file = $request->file('file');
5760 FileSafe::store($file);
58- //
61+ //This is to encrypt the file before it is uploaded to the server.
62+
5963 }
6064 }
6165
6670
6771 namespace App\Http\Controllers;
6872
73+ use FileSafe;
6974 use Illuminate\Http\Request;
7075 use App\Http\Controllers\Controller;
7176
7479
7580 public function upload_file(Request $request)
7681 {
77- $file = 'images.jpg ';
82+ $file = 'encrypted_file.doc ';
7883 return FileSafe::download($file);
79- //
84+ //This is to decrypt files to be downloaded.
8085 }
8186 }
8287
Original file line number Diff line number Diff line change 33
44 'random_filename ' => true ,//Generate random alnum for upload filename,
55
6- 'path ' => 'uploaded/ ' ,//Location uploaded file storage/app,
6+ 'path ' => 'uploaded/ ' ,//Uploaded file is located in storage/app.
77
88
99
10- ];
10+ ];
You can’t perform that action at this time.
0 commit comments