[Progress Communities] [Progress OpenEdge ABL] Forum Post: PASOE/REST/DOH - File Download

Status
Not open for further replies.
J

jts-law

Guest
Has anybody successfully configured a file download via PASOE REST using a Data Object Handler service? In my interface I have the content type set to "multipart/form-data", and the output body is ABL type "CLASS OpenEdge.Net.MultipartEntity". My current code is: COPY-LOB FROM FILE cTmpXlsx TO memptrTmp. /* Load file/memptr into a Memptr object (for MessagePart) */ oMemptr = NEW Memptr(GET-SIZE(memptrTmp)). oMemptr:putBytes(memptrTmp). poEntity = NEW MultipartEntity(). poEntity:Boundary = GUID. oPart = NEW MessagePart('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':u, oMemptr). oHeader = HttpHeaderBuilder:Build('Content-Disposition':u) :Value(SUBSTITUTE('form-data; name="fileContents"; filename=&1':u, QUOTER("Test.xlsx"))) :Header. poEntity:AddPart(oPart). oPart:Headers:put(oHeader). RETURN 200. I have a couple problems. The first is that the file that is downloaded contains all of the part header information. The second is that the downloaded filename is my URI/operation name and not the filename set in the Content-Disposition header. Downloaded file contents: --d2abaee5-58fa-13b3-3714-453b65266f8b Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet Content-Disposition: form-data; name="fileContents"; filename="Profit.xlsx" [File contents] --d2abaee5-58fa-13b3-3714-453b65266f8b-- Thoughts? TIA Louis Winter

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