IQSS / IQSS/dataverse

MIME type of netCDF (.nc) files with direct upload

Open
#9,884 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: File Upload & Handling Type: Bug User Role: Depositor
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

entrepot.recherche.data.gouv.fr

What steps does it take to reproduce the issue?

Have direct upload enabled
Have a netCDF file with a .nc file extension

  • When does this issue occur?

A user downloads a netCDF (.nc) file with direct upload active

  • Which page(s) does it occurs on?

the dataset page

  • What happens?

Having this configuration in the MimeTypeDetectionByFileExtension.properties file: nc=application/netcdf
I expect to get this MimeType in BDD when adding a .nc file to my dataverse.
This is not the case :)

I get the MimeType "application/x-netcdf" and I can't see the previewer for this file because it is configured for the MimeType "application/netcdf"

Note that when I apply a redetect with the API, the result is OK:
{"status":"OK","data":{"dryRun":true,"oldContentType":"application/x-netcdf","newContentType":"application/netcdf"}}

  • To whom does it occur (all users, curators, superusers)?

All the users

  • What did you expect to happen?
  1. For Java and Apache, the MimeType for .nc and .cdf files appears to be "application/x-netcdf".
    Perhaps we need to adapt MimeTypeDetectionByFileExtension.properties and the previewers in order to maintain consistency?

  2. Add "application/x-netcdf" to previewers to enable it for this MimeType

Which version of Dataverse are you using?

5.14

Any related open or closed issues to this bug report?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with MimeTypeDetectionByFileExtension.properties and the previewer configuration, then compare direct-upload detection with the API redetect behavior for .nc and .cdf files. Determine whether the expected fix is to standardize on application/netcdf or support application/x-netcdf in previewers. Done means direct uploads and preview availability are consistent for these MIME types.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.