diff --git a/docs/README.md b/docs/README.md index a1d5da96..255921ca 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1305,7 +1305,9 @@ Return value: offset to the next chunk, or 0 if there are no more chunks. See [File upload tutorial](../tutorials/file-uploads/) for full usage example. -Function mg_http_next_multipart() +A diagram below shows how `mg_http_next_multipart()` in action: + +Function mg_http_next_multipart() Usage example: diff --git a/docs/images/mg_http_next_multipart.png b/docs/images/mg_http_next_multipart.png deleted file mode 100644 index a414559c..00000000 Binary files a/docs/images/mg_http_next_multipart.png and /dev/null differ diff --git a/docs/images/mg_http_next_multipart.svg b/docs/images/mg_http_next_multipart.svg new file mode 100644 index 00000000..f3481f34 --- /dev/null +++ b/docs/images/mg_http_next_multipart.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + struct mg_http_part part;size_t pos = 0;pos = mg_http_next_multipart(&hm->body, pos, &part);pos = mg_http_next_multipart(&hm->body, pos, &part); + + + + Source Code + + + + + + + + + HTTP message + + + POST /upload HTTP/1.1 Content-Type: multipart/form-data; boundary="--xyz"--xyzContent-Disposition: form-data; name="foo"; filename="a.txt"Content-Type: text/plainhello world--xyz---Content-Disposition: form-data; name="bar"; filename="b.txt"Content-Type: text/plainhello world again--xyz-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Part 1 +Part 2 +