phaidra/phaidra-api

Uploading PDF files via API does not set a useful label for the OCTETS datastream

Closed this issue · 1 comments

When uploading a file, e.g. a PDF file, the LABEL attribute in the OCTETS datastream should be the file's name. Currently, it only says "Created by phaidra-api". Also, the MIMETYPE attribute does not reflect the file's real Mediatype.

Example:

<foxml:datastream ID="OCTETS" STATE="A" CONTROL_GROUP="M" VERSIONABLE="true">
<foxml:datastreamVersion ID="OCTETS.0" LABEL="Created by phaidra-api" CREATED="2017-06-14T10:39:45.598Z" MIMETYPE="multipart/form-data;boundary=nxPHX" SIZE="5558359">
<foxml:contentLocation TYPE="INTERNAL_ID" REF="o:200349+OCTETS+OCTETS.0"/>
</foxml:datastreamVersion>
</foxml:datastream>

Name should be fixed
5ff76c5#diff-d69844d7cc731531607d9bf982643754R242

Mimetype should be sent as parameter, otherwise heuristics is used.