Last modified: 2011-03-13 18:04:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5336, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3336 - use directory structure for file uploads
use directory structure for file uploads
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: 8548 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2005-09-02 16:18 UTC by Andy Somerville
Modified: 2011-03-13 18:04 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Preserves the directory structure of uploaded files (4.40 KB, patch)
2007-01-09 02:42 UTC, Luis Zarrabeitia

Description Andy Somerville 2005-09-02 16:18:10 UTC
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.
Comment 1 Brion Vibber 2005-09-02 23:33:48 UTC
Doesn't seem to be much purpose or benefit to this.

Resolving as WONTFIX.
Comment 2 Andy Somerville 2005-09-02 23:47:29 UTC
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.

Comment 3 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-01-09 02:20:19 UTC
*** Bug 8548 has been marked as a duplicate of this bug. ***
Comment 4 Luis Zarrabeitia 2007-01-09 02:33:57 UTC
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.
Comment 5 Luis Zarrabeitia 2007-01-09 02:42:10 UTC
Created attachment 3037 [details]
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.

Note You need to log in before you can comment on or make changes to this bug.