Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a16d349 commit c955890Copy full SHA for c955890
1 file changed
File-uplading.md
@@ -0,0 +1,23 @@
1
+## File Uploading
2
+
3
+File uploading is very simple and easy in unic framework.
4
5
+Let's handle file uploading:
6
+```php
7
+$app->post('/file', function($req, $res) {
8
+ // Save uploaded file
9
+ if ($req->files->has('image')) {
10
+ $req->files->get('image')->save(base_path('public'));
11
+ }
12
+ // Get all file details
13
+ $res->json($req->files->getAll());
14
+});
15
+```
16
17
+We can access uploaded file details using `$req->files` object.
18
19
+Change uploaded file name:
20
21
22
+$req->files->get('image')->save(base_path('public'), 'cat.png');
23
0 commit comments