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 1
1
2
2
# 🚀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 >
4
6
<h3 >🛠️ Installation with Composer </h3 >
5
7
6
- composer require irfa/raja-ongkir
8
+ composer require irfa/encrypt-file-laravel
7
9
8
10
> You can get Composer [ here] ( https://getcomposer.org/download/ )
9
11
45
47
46
48
namespace App\Http\Controllers;
47
49
50
+ use Filesafe;
48
51
use Illuminate\Http\Request;
49
52
use App\Http\Controllers\Controller;
50
53
55
58
{
56
59
$file = $request->file('file');
57
60
FileSafe::store($file);
58
- //
61
+ //This is to encrypt the file before it is uploaded to the server.
62
+
59
63
}
60
64
}
61
65
66
70
67
71
namespace App\Http\Controllers;
68
72
73
+ use FileSafe;
69
74
use Illuminate\Http\Request;
70
75
use App\Http\Controllers\Controller;
71
76
74
79
75
80
public function upload_file(Request $request)
76
81
{
77
- $file = 'images.jpg ';
82
+ $file = 'encrypted_file.doc ';
78
83
return FileSafe::download($file);
79
- //
84
+ //This is to decrypt files to be downloaded.
80
85
}
81
86
}
82
87
Original file line number Diff line number Diff line change 3
3
4
4
'random_filename ' => true ,//Generate random alnum for upload filename,
5
5
6
- 'path ' => 'uploaded/ ' ,//Location uploaded file storage/app,
6
+ 'path ' => 'uploaded/ ' ,//Uploaded file is located in storage/app.
7
7
8
8
9
9
10
- ];
10
+ ];
You can’t perform that action at this time.
0 commit comments