Decoding issue binary file from multipart/form-data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 12:22 AM
Hello Community,
For a scripted API, I think I've got a decoding issue when extracting the content of binary files. When uploaded with a multipart/form-data POST.
I followed the suggestions from this post. Unfortunately "Packages.java.lang.String" is not available to scoped applications (which is the advised way to develop applications these days).
So, dumping the whole request into an attachment and re-reading it with GlideSysAttachment().getContent(attachmentGr).split("\r\n") yields something akin to the original request. The boundaries are visible, but the bodies of the binary files are encoded in an unknown way. It's not even clear whether the original data can be restored from it.
Getting the attachment's content in BASE64 would probably preserve the binary content, but then the boundaries of the multipart request are not visible.
Does somebody has a suggestion how I could proceed to recuperate the binary files ? In a scoped application that is.
THX !