DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:preservefilenames

This is an old revision of the document!


PreserveFilenames Plugin

Compatible with DokuWiki

2009-12-25, 2010-11-07, rc2011-04-22

plugin Preserves the original name of the uploaded media file (letter cases, symbols, etc.)

Last updated on
2010-04-14
Provides
Action, Render
Repository
Source
Conflicts with
any_wysiwyg_editors

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with file, media

Download and Installation

Download and install the plugin using the Plugin Manager using the following URL.

:!: Using the Plugin Manager is the recommended way. If you are manually installing, you need to rename the extracted directory to “preservefilenames”. In that case, refer to Plugins on how to install plugins manually.

Changelog:

Overview

By default, DokuWiki normalizes media file names by means of normalized method documented in pagenames.

For example, a media file which name is “[DW] My DokuWiki Stuff.zip” is normalized into “dw_my_dokuwiki_stuff.zip” and this normalized name is used as a file name to store file entity in a file system on the DokuWiki server. However, in some cases you might want to use upper case letters, symbols or white spaces in a file name.

By installing this plugin, you can use uploaded media file with its original name instead of normalized name. Letter cases, spaces, symbols and multibyte characters in a file name will all be preserved.

Features

Filename preservation

This plugin uses a meta file to store and retrieve an original name of an uploaded file.

Storing Process:

  • Occurred when:
    • Uploading files via upload interface of DokuWiki
  • Process details:
    1. An user uploads a file (ex. "[DW] My DokuWiki Stuff.zip") via upload interface of DokuWiki
    2. DokuWiki normalizes the file name into "dw_my_dokuwiki_stuff.zip"
    3. DokuWiki stores the file in "data/media/dw_my_dokuwiki_stuff.zip"
    4. The plugin creates a meta file "data/meta/dw_my_dokuwiki_stuff.zip.filename"
    5. The plugin stores original file name in the meta file

Retrieving Process:

  • Occurred when:
    • Filling label text of media links with no designated label text in wiki pages
    • Displaying a file list in media manager
    • Inserting selected media file syntax into wiki text using javascript in media manager
    • Downloading a media file to set its file name
  • Process details:
    1. The plugin checks if there is a meta file for a media file
    2. If the meta file exists, the plugin replaces a normalized file name with its original file name

As the default behavior of DokuWiki, media links written in syntax like {{:[DW] My DokuWiki Stuff.zip}} are recognized as normalized media IDs like {{:dw_my_dokuwiki_stuff.zip}} by DokuWiki. And, this plugin stores uploaded media files using default file storing method of DokuWiki (e.g. stored as normalized file name).

So if you don't like this plugin, you can safely uninstall this plugin without any side effects.

Better filename handling in snippet download

This plugin resolves PHP Bug #37738 and introduces RFC 2231 style Content-Disposition header for compliant browsers to mainly make a correct handling for East Asian characters in file names.

For example, you can download snippet below as “文書_1.txt” instead of “_1.txt” by installing this plugin.

文書_1.txt
Sample text

Configuration

There are no configuration options for this plugin.

Notes

  • When you want to preserve file names, you cannot use FTP or any other “direct” methods to upload files. Since this plugin uses meta data to store original file name, you are required to use DokuWiki's normal file upload interface (including multi uploader) to set meta data.
  • Even if original file names are different, you need to pay attention whether the names are normalized into the same media ID or not. For example, both [1].txt and (1).txt are normalized into the same 1_.txt by DokuWiki. You cannot upload both files in same namespace.

Feedback

Any feedback is welcome. Please use the Issue Tracker to send your feedback.

plugin/preservefilenames.1303753458.txt.gz · Last modified: 2011-04-25 19:44 by kazmiya

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki