joemfb / ml-common-ng

An angular module of common components for the MarkLogic REST API
https://joemfb.github.io/ml-common-ng/
2 stars 2 forks source link

updateDocument fails on some binaries #24

Open grtjn opened 8 years ago

grtjn commented 8 years ago

ml-uploader-ng uses mlRest.updateDocument to upload files to MarkLogic, but even though it specifies format=binary, particular files fail. I guess for extensions that are unknown to MarkLogic. Adding this line to updateDocument seemed to fix that:

headers: (options.format === 'binary') ? { 'Content-Type' : 'application/octet-stream' } : {}

It may need some more thought, and it may need to be applied on other places, but this made ml-uploader work for those files..