http file_server : Fix README of example

This commit is contained in:
Anurag Kar 2019-01-15 12:45:48 +05:30
parent 72d2d2845d
commit c2fb45b6ef

View File

@ -1,8 +1,8 @@
# Simple HTTPD File Server Example # Simple HTTP File Server Example
(See the README.md file in the upper level 'examples' directory for more information about examples.) (See the README.md file in the upper level 'examples' directory for more information about examples.)
HTTP file server example demonstrates file serving using the 'esp_http_server' component of ESP-IDF: HTTP file server example demonstrates file serving using the `esp_http_server` component of ESP-IDF:
1. URI `/path/filename` for GET command downloads the corresponding file (if exists) 1. URI `/path/filename` for GET command downloads the corresponding file (if exists)
2. URI `/upload` POST command for uploading the file onto the device 2. URI `/upload` POST command for uploading the file onto the device
3. URI `/delete` POST command for deleting the file from the device 3. URI `/delete` POST command for deleting the file from the device
@ -11,8 +11,7 @@ File server implementation can be found under `main/file_server.c` which uses SP
## Usage ## Usage
* Configure the project using `make menuconfig` and goto : * Configure the project using `make menuconfig` and goto `Example Configuration` ->
* Example Configuration ->
1. WIFI SSID: WIFI network to which your PC is also connected to. 1. WIFI SSID: WIFI network to which your PC is also connected to.
2. WIFI Password: WIFI password 2. WIFI Password: WIFI password
@ -25,12 +24,10 @@ File server implementation can be found under `main/file_server.c` which uses SP
3. click a file link to download / open the file on browser (if supported) 3. click a file link to download / open the file on browser (if supported)
4. click the delete link visible next to each file entry to delete them 4. click the delete link visible next to each file entry to delete them
4. test the example using curl (assuming IP is 192.168.43.130): 4. test the example using curl (assuming IP is 192.168.43.130):
1. `curl -X POST --data-binary @myfile.html 192.168.43.130:80/upload/path/on/device/myfile_copy.html` 1. `myfile.html` is uploaded to `/path/on/device/myfile_copy.html` using `curl -X POST --data-binary @myfile.html 192.168.43.130:80/upload/path/on/device/myfile_copy.html`
* `myfile.html` is uploaded to `/path/on/device/myfile_copy.html` 2. download the uploaded copy back : `curl 192.168.43.130:80/path/on/device/myfile_copy.html > myfile_copy.html`
2. `curl 192.168.43.130:80/path/on/device/myfile_copy.html > myfile_copy.html` 3. compare the copy with the original using `cmp myfile.html myfile_copy.html`
* Downloads the uploaded copy back
3. Compare the copy with the original using `cmp myfile.html myfile_copy.html`
## Note ## Note
Browsers often send large header fields when an HTML form is submit. Therefore, for the purpose of this example, 'HTTPD_MAX_REQ_HDR_LEN' has been increased to 1024 in `sdkconfig.defaults`. User can adjust this value as per their requirement, keeping in mind the memory constraint of the hardware in use. Browsers often send large header fields when an HTML form is submit. Therefore, for the purpose of this example, `HTTPD_MAX_REQ_HDR_LEN` has been increased to 1024 in `sdkconfig.defaults`. User can adjust this value as per their requirement, keeping in mind the memory constraint of the hardware in use.