On Oct 6, 2004, at 5:58 PM, Rick Ciesla wrote:
It has been chosen for me to not enable image uploads for regular users through the MediaWiki interface, however I still wish to allow my Wiki to use images as if they had already been uploaded. This would presumably require me to manually copy files I wish to "upload" to the /images directory (and any applicable subdirectories) and also manually create a proper entry in the "image" table in the MySQL database.
You might consider a slight hack to change Special:Upload from being open to all users to being open only to administrators. This would save the trouble of rewriting a separate tool (unless of course you want one, say to do mass uploads easily).
Find this line in SpecialPages.php: "Upload" => new SpecialPage( "Upload" ), and change it to: "Upload" => new SpecialPage( "Upload", "sysop" ),
And to hide the link from the sidebar, change this bit in SkinPHPTal.php: if( $this->loggedin && !$wgDisableUploads ) { to: if( $this->loggedin && !$wgDisableUploads && $wgUser->isSysop) {
So far, my attempts to simply insert the name of the image in the img_name field and manually copy my file to "/wiki/images" have not worked. Obviously I have zero understanding of what the fields in the image table are supposed to contain.
Can somebody please post some valid data from their image table in their database along with the proper sub-directory structure beneath the "images" or "upload" directory (if applicable)?
Here's what I have sitting in my 1.3 test wiki (it's just one image): *************************** 1. row *************************** img_name: VegTomato.jpg img_size: 2438 img_description: dddd img_user: 1 img_user_text: WikiSysop img_timestamp: 20040928234934
img_user is a key to user_id; img_description is freeform text up to 255 characters. It's displayed in the revision list when you look at the image page, and is formatted in the same way as edit comments. img_timestamp is in the same format as our other timestamps, YYYYMMDDHHMMSS and should be in UTC rather than local time.
img_name should not contain spaces; as with page titles, use underscores. If you want non-ASCII characters in filenames, be sure to use the encoding that matches what the wiki is set for (either UTF-8 unicode or 8-bit ISO 8859-1). If you're not on a standard Unix/Linux filesystem there may be funky restrictions on non-ASCII filenames. (Latin-1 names will not work on Mac OS X / HFS+, I haven't tested on Windows.)
The file is at images/b/bf/VegTomato.jpg; the subdirectories are respectively the first and first two hexademical digits of the MD5 sum of the file name (in this case the full sum is bf79999a6a7fe8554814185369f7017d). They're not secret, it's just to even out the distribution so when you have 200,000 images uploaded it's not as unwieldy to do directory listings as it might be. :)
-- brion vibber (brion @ pobox.com)