Page MenuHomePhabricator

use directory structure for file uploads
Closed, DeclinedPublic


Author: andy.somerville

allow uploads to be uploaded into different "directories". Implement this by
replacing directory separator with character which otherwise is disallowed from
file name, but would not cause problems when storing and retrieveing files.
Store all files as currently done, but use new directory separator as a way to
implement logical directories in the interface.

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 8:47 PM
bzimport set Reference to bz3336.
bzimport added a subscriber: Unknown Object (MLST).

Doesn't seem to be much purpose or benefit to this.

Resolving as WONTFIX.

andy.somerville wrote:

Many people have problems with filename conflicts. Many other wikis have upload
schemes where the files are separated into directories. This eliminates the
problem with confilcts of common names, and encourages people to separate files
specific to a particular subject from the main pool of files. Its the same
reason that file structures exist in the first place. Please ask other users if
this is a desired feature before discarding.

ayg wrote:

*** Bug 8548 has been marked as a duplicate of this bug. ***

kyrie wrote:

I'm also interested on having the ability of uploading files to different
subdirectories (preserve the directory structure), i.e, to be able to upload
[[Image:/dir1/image.png]] and [[Image:/dir2/image.png]]. The current behavior is
that the image gets uploaded as Image.png, and none of those links work. My
proposal is to create the directories as needed, so they'll both work and point
to different images.

Advantage: on some situations, there is conflict with the filenames. For
instance, on my university, two professors cannot upload a
[[Media:Conference1.pdf]]. This proposal would allow them to upload a
[[Media:class1/Conference1.pdf]] and [[Media:class2/Conference1.pdf]] and solve
the conflict. The solution suggested by Brion Vibber at 8548 doesn't help me a
lot, as it depends on the user's well naming conventions and little can be done
to detect or prevent accidents (where the directory convention would give a
strict naming scheme that can be checked by a hook to prevent one user
accidentally overwriting another user's files)

Disadvantages: I don't know - yet.

I wrote a patch that implements this. Please look at the commented section
that asks "Why is this here?". I couldn't figure out if it was required because of
security concerns. I'll attach the my proposal right away.

kyrie wrote:

Preserves the directory structure of uploaded files

It applies against mediawiki 1.6 and 1.9 (svn). I'm currently using it (and
plan on making a userCan hook to prevent accidents) to store the online
documents of my department.