Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29453

Fix mime-type detection

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The MIME type detection will be done for any type starting by application/octet-stream.
    • Backlog priority:
      800
    • Sprint:
      nxsupport 12

      Description

      When using any browser on Mac OS to upload a ARW file or a NEF file using the S3 direct upload, an empty mime-type is provided to aws-jdk, defaulting it to application/octet-stream; charset=UTF-8.

      The issue is that the Nuxeo Platform triggers its server-side mime-type resolution only if the mime-type is unspecified or application/octet-stream, see https://github.com/nuxeo/nuxeo/blob/e018af03de77189b05dc32357260f202b47e49d1/modules/platform/nuxeo-platform-filemanager-core-listener/src/main/java/org/nuxeo/ecm/platform/filemanager/core/listener/MimetypeIconUpdater.java#L149. Here is a fix suggestion:

      @@ -120,7 +120,7 @@ public class MimetypeIconUpdater implements EventListener {
               }
       
               Blob blob = dirtyProperty.getValue(Blob.class);
      -        if (blob != null && (blob.getMimeType() == null || blob.getMimeType().equals(OCTET_STREAM_MT))) {
      +        if (blob != null && (blob.getMimeType() == null || blob.getMimeType().startsWith(OCTET_STREAM_MT))) {
                   // update the mimetype (if not set) using the the mimetype registry
                   // service
                   blob = mimetypeService.updateMimetype(blob);
      

      But the fact that aws-jdk adds "; charset=UTF-8" could have been fixed in a most recent version, or the fix could be in our javascript code calling aws-jdk.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 45 minutes
                1h 45m