|
@@ -105,7 +105,7 @@ These features match features in v1 (see branch "v1"):
|
105
|
105
|
- [x] Supports POST variables as input (x-www-form-urlencoded)
|
106
|
106
|
- [x] Supports a JSON object as input
|
107
|
107
|
- [x] Supports a JSON array as input (batch insert)
|
108
|
|
- - [x] Supports file upload from web forms (multipart/form-data)
|
|
108
|
+ - [ ] ~~Supports file upload from web forms (multipart/form-data)~~
|
109
|
109
|
- [ ] ~~Condensed JSON output: first row contains field names~~
|
110
|
110
|
- [x] Sanitize and validate input using callbacks
|
111
|
111
|
- [x] Permission system for databases, tables, columns and records
|
|
@@ -734,26 +734,7 @@ The above example will add a header "X-Time-Taken" with the number of seconds th
|
734
|
734
|
|
735
|
735
|
### File uploads
|
736
|
736
|
|
737
|
|
-The 'fileUpload' middleware allows you to upload a file using a web form (multipart/form-data) like this:
|
738
|
|
-
|
739
|
|
-```
|
740
|
|
-<form method="post" action="http://localhost/api.php/records/categories" enctype="multipart/form-data">
|
741
|
|
- Select image to upload:
|
742
|
|
- <input type="file" name="icon">
|
743
|
|
- <input type="submit">
|
744
|
|
-</form>
|
745
|
|
-```
|
746
|
|
-
|
747
|
|
-Then this is handled as if you would have sent:
|
748
|
|
-
|
749
|
|
-```
|
750
|
|
-POST http://localhost/api.php/records/categories
|
751
|
|
-{"icon_name":"not.gif","icon_type":"image\/gif","icon":"ZGF0YQ==","icon_error":0,"icon_size":4}
|
752
|
|
-```
|
753
|
|
-
|
754
|
|
-As you can see the "xxx_name", "xxx_type", "xxx_error" and "xxx_size" meta fields are added (where "xxx" is the name of the file field).
|
755
|
|
-
|
756
|
|
-NB: You cannot edit a file using this method, because browsers do not support the "PUT" method in these forms.
|
|
737
|
+File uploads are supported through the [FileReader API](https://caniuse.com/#feat=filereader).
|
757
|
738
|
|
758
|
739
|
## OpenAPI specification
|
759
|
740
|
|