sph-lib includes a multipart-form-data parser that can do partial reading and supports unlimited nesting of parts.
(import (sph) (sph web html)) (define example-data (open-input-string "-----------------------------19737173311706079401624261242\r\nContent-Disposition: form-data; name=\"content\"\r\n\r\naeu\r\n-----------------------------19737173311706079401624261242\r\nContent-Disposition: form-data; name=\"names\"\r\n\r\n[\"a\",\"b\"]\r\n-----------------------------19737173311706079401624261242\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\ndocl\r\n-----------------------------19737173311706079401624261242--\r\n")) (html-read-multipart-form-data example-data)
the result:
(((("Content-Disposition" ("form-data" . #t) ("name" . "type"))) . "docl") ((("Content-Disposition" ("form-data" . #t) ("name" . "names"))) . "[\"a\",\"b\"]") ((("Content-Disposition" ("form-data" . #t) ("name" . "content"))) . "aeu"))
(html-multipart-form-data-ref result "submit-name")
((("Content-Disposition" ("form-data" . #t) ("name" . "submit-name"))) . "Larry")