-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auxiliary file download: JSON file extension/type is lost #8241
Comments
Thanks @raprasad. We can take a look. If you wouldn't mind, could you please see if this happens in 5.8 (on demo.dataverse.org)? |
This is definitely a known issue and has been true since 5.5. 5c67f95 is a related commit we can look at. When we fix this we should also adjust the tests that have comments like In short, the context type (MIME type) for these JSON files is being stored in Dataverse as "text/plain" rather than "application/json". |
Looks like the core problem is that the mimetype detection used (
|
Since this is at the top of Up Next I thought I'd mention that pull request #8237 is related so watch our for potential merge conflicts. |
|
"application/octet-stream" is the default when the user doesn't supply a content type. So if it's this, send it through Tika. Yes, a user can supply "application/octet-stream" and this will also be sent through Tika.
@pdurbin: Has a format been decided upon for sending over the content type? If so, will it be backward compatible with the current API? Thanks. |
allow users to override content type for aux files #8241
@raprasad yes, a format has been decided. Pull request #8282 has been merged and it's probably easiest to show the "diff" of the curl command: That is to say, from curl you'll pass something like this:
And yes, the change is backward compatible. If you don't specify a content type we'll run the file through Tika.detect in the hopes of figuring out what it is. |
Thanks @pdurbin |
"application/octet-stream" is the default when the user doesn't supply a content type. So if it's this, send it through Tika. Yes, a user can supply "application/octet-stream" and this will also be sent through Tika.
What steps does it take to reproduce the issue?
dp_release.json
):(Note: this doesn't happen when adding PDFs as auxiliary files)
When does this issue occur?
When downloading an auxiliary JSON file.
Which page(s) does it occurs on?
Dataset page, file download dropdown.
What happens?
See steps to reproduce above
To whom does it occur (all users, curators, superusers)?
Tested this as the dataset owner.
What did you expect to happen?
The file would be downloaded with a
.json
extensionWhich version of Dataverse are you using?
v. 5.5 build develop-6cb87ee5d
Any related open or closed issues to this bug report?
The text was updated successfully, but these errors were encountered: