Problem/Motivation
The links in the File column of the archive list (/admin/content/earkiv) do not download the archive. In Chrome the link opens a new tab instead.
The file entity of the archive is created without a MIME type, so filemime is empty in file_managed. The response for the private file then has no Content-Type header and no Content-Disposition header, and the browser has to guess what to do with a file of several gigabytes.
Steps to reproduce
- Create and store an archive.
- Go to /admin/content/earkiv and click the file name.
- Chrome opens a new tab instead of downloading the file.
curl -Ion the file URL shows noContent-Type.
Proposed resolution
- Set the MIME type
application/gzipwhen the file entity of the archive is created. - Add the
downloadattribute to the link in the archive list, so the browser saves the file instead of opening it. - Add a post update function that sets the MIME type of the existing archive files.
Remaining tasks
- Implement and test.
- Review.
User interface changes
Clicking an archive in the list downloads it.
API changes
None.
Data model changes
None. A post update function sets filemime for existing archive files.
AI-Generated: Yes (Used Claude Code to find the cause and draft this issue.)
Issue fork earkiv-3636834
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
thomas alsén commentedMerged into 1.0.x!