Skip to content

Commit 0d1a6c1

Browse files
committed
docs
1 parent 341345d commit 0d1a6c1

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -577,29 +577,6 @@ For spatial support there is an extra set of filters that can be applied on geom
577577

578578
These filters are based on OGC standards and so is the WKT specification in which the geometry columns are represented.
579579

580-
### File uploads
581-
582-
The 'fileUpload' middleware allows you to upload a file using a web form (multipart/form-data) like this:
583-
584-
```
585-
<form method="post" action="http://localhost/api.php/records/categories" enctype="multipart/form-data">
586-
Select image to upload:
587-
<input type="file" name="icon">
588-
<input type="submit">
589-
</form>
590-
```
591-
592-
Then this is handled as if you would have sent:
593-
594-
```
595-
POST http://localhost/api.php/categories
596-
{"icon_name":"not.gif","icon_type":"image\/gif","icon":"ZGF0YQ==","icon_error":0,"icon_size":4}
597-
```
598-
599-
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).
600-
601-
NB: You cannot edit a file using this method, because browsers do not support the "PUT" method in these forms.
602-
603580
### Authentication
604581

605582
Authentication is done by means of sending a "Authorization" header. It identifies the user and stores this in the `$_SESSION` super global.
@@ -752,6 +729,29 @@ You may use the "customization" middleware to modify request and response and im
752729

753730
The above example will add a header "X-Time-Taken" with the number of seconds the API call has taken.
754731

732+
### File uploads
733+
734+
The 'fileUpload' middleware allows you to upload a file using a web form (multipart/form-data) like this:
735+
736+
```
737+
<form method="post" action="http://localhost/api.php/records/categories" enctype="multipart/form-data">
738+
Select image to upload:
739+
<input type="file" name="icon">
740+
<input type="submit">
741+
</form>
742+
```
743+
744+
Then this is handled as if you would have sent:
745+
746+
```
747+
POST http://localhost/api.php/categories
748+
{"icon_name":"not.gif","icon_type":"image\/gif","icon":"ZGF0YQ==","icon_error":0,"icon_size":4}
749+
```
750+
751+
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).
752+
753+
NB: You cannot edit a file using this method, because browsers do not support the "PUT" method in these forms.
754+
755755
## OpenAPI specification
756756

757757
On the "/openapi" end-point the OpenAPI 3.0 (formerly called "Swagger") specification is served.

0 commit comments

Comments
 (0)