The logs were the ones I wrote in my previous response, however I found the solution to be this one:
set boundary = $PIECE(pRequest.HTTPHeaders.GetAt("content-type"),"boundary=",2)
Set reader = ##class(%Net.MIMEReader).%New()
Set sc = reader.OpenStream(pRequest.Stream)
If $$$ISERR(sc) {
$$$LOGERROR("Failed to open stream: "_$System.Status.GetErrorText(sc))
Quit
}
set a=0
while a'=1 {
Set sc=reader.readHeader(.message,1)
$$$LOGINFO(message.GetHeader("Content-Type"))
$$$LOGINFO($p(message.GetHeader("Content-Disposition"),"""",2))
Set sc=reader.readBody(message,boundary,.a)
Set body = message.Body.Read()
$$$LOGINFO(body)
}The key was to correctly retrieve the boundry in the first place.
Thank you again for your solution which turned out to be correct!
- Log in to post comments