Maurits van der Schee 6 年前
父节点
当前提交
0d1a6c141b
共有 1 个文件被更改,包括 23 次插入23 次删除
  1. 23
    23
      README.md

+ 23
- 23
README.md 查看文件

@@ -577,29 +577,6 @@ For spatial support there is an extra set of filters that can be applied on geom
577 577
 
578 578
 These filters are based on OGC standards and so is the WKT specification in which the geometry columns are represented.
579 579
 
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
-
603 580
 ### Authentication
604 581
 
605 582
 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
752 729
 
753 730
 The above example will add a header "X-Time-Taken" with the number of seconds the API call has taken.
754 731
 
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
+
755 755
 ## OpenAPI specification
756 756
 
757 757
 On the "/openapi" end-point the OpenAPI 3.0 (formerly called "Swagger") specification is served. 

正在加载...
取消
保存