Page MenuHomeMiraheze

Requesting download from MultiMedia Viewer does not work
Closed, ResolvedPublic

Description

Then you visit this https://static.miraheze.org/gpcommonswiki/6/60/Commons-logo-black-which.png?download the download is supposed to start automatically. Also viewing from the MultiMedia Viewer (https://gpcommons.miraheze.org/wiki/File:Miraheze_logo.svg#/media/File:Miraheze_logo.svg), when you try to download from the download button, the download is supposed to start automatically, but all these doesn't work.

This doesn't work on any wiki I have tried it from.

I assume it is a bug, wrong configuration, or something that is supposed to be done but not done.

Event Timeline

Excelsis triaged this task as Normal priority.Jan 13 2023, 10:35
Excelsis created this task.
Herald added subscribers: Unknown Object (User), Unknown Object (User), Reception123. · View Herald TranscriptJan 13 2023, 10:35
OrangeStar subscribed.

The extension has a section about these situations (https://www.mediawiki.org/wiki/Extension:MultimediaViewer#Configuration). TLDR It requires sending a header at the web server level: "If the requested URL to an image directory contains the download query parameter, the Content-Disposition header must be set to attachment".

However, unless you're trying to support Internet Explorer in 2023, this should really be done by setting the download attribute at the <a> element in the extension's code instead.

I've attempted to port the Wikimedia version to Miraheze: https://github.com/miraheze/puppet/pull/3121.

Reviews are very much welcome, I've never used either Varnish or Puppet.

The PR got merged, should be working once the change is deployed to production