[progress Communities] [progress Openedge Abl] Forum Post: Http Client Passing Bytes() As...

  • Thread starter Thread starter Rod Anderson
  • Start date Start date
Status
Not open for further replies.
R

Rod Anderson

Guest
I have a requirement to pass a blob (file) "converted to an array of bytes". From research in this community, I've tried a few things including System.IO.Memory Stream() as seen below. I've also tried the method MemptrToByteArray() which is referenced in the community many times. Regardless the appraoch I'm having difficulty getting the array to attached to the form. If I copy it back to a memptr it converts to the original file? Any insight would be appreciated. Best Regards, Rod oMemStream = NEW System.IO.MemoryStream(iSize). DO ix = 1 TO iSize: oMemStream:WriteByte(GET-BYTE(mData,ix)). END. ASSIGN oSoapDoc = NEW MEMPTR(mData) oPart = NEW MessagePart('application/octet-stream':u, oSoapDoc) oPart:ContentId = 'blob' . oPart:Headers:Put(HttpHeaderBuilder:Build('Content-Disposition') :Value('form-data; name="blob"; filename="QCDSC221.xml"') :Header). oMultiEntity:AddPart(oPart).

Continue reading...
 
Status
Not open for further replies.
Back
Top