Page MenuHomePhabricator

Use a meaningful file name for the download
Closed, ResolvedPublic

Description

When you download for example the MW Developers Guide
http://www.mediawiki.org/w/index.php?title=Special:Book&bookcmd=render_collection&colltitle=User:Wikinaut/Books/MediaWiki_Developer%27s_Guide&writer=rl

you'll get a PDF file titled "collection.pdf" when storing the PDF.

Suggestion

Better would be a meaningful file name title which corresponds to the Wiki book/collection page title. Non-ASCII character need to be stripped, or transliterated or url-encoded, and spaces replaced with underscore.


Version: unspecified
Severity: enhancement

Details

Reference
bz30845

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:52 PM
bzimport added a project: Collection.
bzimport set Reference to bz30845.
bzimport added a subscriber: Unknown Object (MLST).

Same problem with ZIM files, "collection.zim".

I just submitted a patch for this bug: gerrit change I0c53d31e43354a63dcc115b59a961e43bb86e8c4

It still has a few issues though:

  • it works only for Latin-1
  • Accented characters will be converted to ASCII
  • Everything else will be dropped
  • If everything is dropped, "collection" + EXT will be used as filename

(In reply to comment #0)

Better would be a meaningful file name title which corresponds to the Wiki
book/collection page title. Non-ASCII character need to be stripped, or
transliterated or url-encoded, and spaces replaced with underscore.

Please don't forget that titles in non-english wiki projects are completely Non-ASCII. So don't drop them :)
What issue do you see when file name contains valid UTF-8 characters?

This is a quick fix. HTTP can only handle ASCII characters by default. RFC 5987 describes a way to handle UTF-8 filenames, but this requires some additional work and will not work in legacy browsers.