adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
219 stars 114 forks source link

Sending statements with binary attachments is not supported #117

Closed wobrien closed 5 years ago

wobrien commented 5 years ago

The current implementation for sending statements with attachments does not support sending binary data, for example an image or pdf. Currently the code uses strings to store / concat together the multipart/mixed request, to support sending binary data this would need to be update to use something like ArrayBuffers.

vbhayden commented 5 years ago

Are you able to serialize those things into a text encoding and submit them as a part of your multipart/mixed request that way?

wobrien commented 5 years ago

Are you able to serialize those things into a text encoding and submit them as a part of your multipart/mixed request that way?

I could possibly serialize them BASE64 encoded, but I think this would be departing from the XAPI spec which says that attachments should use 'Content-Transfer-Encoding': 'binary', according to the RFC this implies that NO encoding has been performed.

brian-learningpool commented 5 years ago

@wobrien, @vbhayden, please check out the PR I've made which resolves this.