use of org.apache.commons.fileupload.MultipartStream in project Lucee by lucee.
the class MultiPartResponseUtils method getParts.
public static Array getParts(byte[] barr, String contentTypeHeader) throws IOException, PageException {
String boundary = extractBoundary(contentTypeHeader, "");
ByteArrayInputStream bis = new ByteArrayInputStream(barr);
MultipartStream stream;
Array result = new ArrayImpl();
//
stream = new MultipartStream(bis, getBytes(boundary, "UTF-8"));
boolean hasNextPart = stream.skipPreamble();
while (hasNextPart) {
result.append(getPartData(stream));
hasNextPart = stream.readBoundary();
}
return result;
}
Aggregations