bcgov/OCWA

Missing filetype/mimetype description

Closed this issue · 2 comments

OCWA Issue

User Story

As a researcher,

I want to be able to upload files and see the file/mime type displayed

so that I have feedback and knowledge of the file type that I just uploaded.

Test Case

ENV

  • DEV
  • TEST
  • PROD

TESTCASE

  • Login and create new request
  • Click Add files
  • Drag and drop the LICENSE file from the OCWA repository as a file to submit

EXPECTED

  • The file should successfully submit, with a filetype displayed as text/plain (or similar)
  • Subsequent screens should also display text/plain (or similar) for the uploaded file

ACTUAL

  • The filetype field is not populated.

capture

ERROR

  • The following is a parse of the License file's info metadata stored by Minio. Note that filetype/mimetime is not present in the data structure.
    {"ID":"1b427c058b82f26c114863e468a0725d+6ed67e07-36ac-47bb-87d4-4a450e0a5dae","Size":11558,"SizeIsDeferred":false,"Offset":0,"MetaData":{"fileName":"LICENSE","jwt":"redacted","lastModified":"1548877418431","size":"11558"},"IsPartial":false,"IsFinal":false,"PartialUploads":null}

Notes

  • This is a followup to Issue #64 and dependent on PR #73

I've added a fallback here to show the content-type if the file-type isn't defined when I request the metadata from Minio. I didn't have the validation microservice running locally and the file-type survived when I used a LICENSE file as a tester, but I tried the staging server and the file-type did not, so I wonder if there's something going on post-upload that might be causing it in the validation API. Either way there'll be a value of some sort.

Successfully tested in test environment