DataStream is a stream that signals end_of_file
if the
multipart boundary is encountered. The stream can be reset to
read the next part using multipart_open_next/1. Options:
- close_parent(+Boolean)
- Close Stream if DataStream is closed.
- boundary(+Text)
- Define the boundary string. Text is an atom, string, code or
character list.
All parts of a multipart input can be read using the following
skeleton:
process_multipart(Stream) :-
multipart_open(Stream, DataStream, [boundary(...)]),
process_parts(DataStream).
process_parts(DataStream) :-
process_part(DataStream),
( multipart_open_next(DataStream)
-> process_parts(DataStream)
; close(DataStream)
).
- license
- - The multipart parser contains code licensed under the
MIT license, based on node-formidable by Felix Geisendoerfer
and Igor Afonov.