Manual talk:$wgFileExtensions

From MediaWiki.org
Jump to: navigation, search

Contents

[edit] 1 File Type Errors

I can upload xls files but not doc files. The exact error message is: "".doc" is an unwanted file type List of allowed file types: gif, jpg, xls, pdf". I've tried turning of strict extensions, mime detection, and more... Nothing I've tried seems to allow them. I've also noticed the list of allowed filetypes never changes. Any ideas? -- Shannon_Lowder


I have done this... and the 'ppt' and 'xls' do not work. All others in the array do work. What is wrong?

[email protected]


I am having the same problem as cody is in regards to 'xls' files. It's CLEARLY in the array, and other files in the array work just fine. Attempting to upload .xls files results in "The file is corrupt or has an incorrect extension. Please check the file and upload again." Does anyone have any suggestions? Thanks! [email protected]

Answer: This is most probably due to the mime type checking - look at Manual:Mime type detection and see if your answer is there.

uploading pdf files work for me, but I still cannot upload mp3 files


-Tom

-the problem was that the filesize was too long

[edit] Uploading ods file

I am trying to upload an ods file. I have set the mime types for the file in mime.types. But on uploading an ods file why is media wiki recognizing it as a zip file?

Any suggestions?   [email protected]



[edit] Upload exe-files

I can't enable the file upload of exe-files. I added the fileextension ("exe" and even ".exe"), and looked for the file-size in php.ini

Answer: exe are listed in $wgFileBlacklist. To allow 'exe' uploads you must remove 'exe' from the blacklist in addition to the changes you normally need to make (ie, "$wgFileExtensions[] = 'exe';").

[edit] 2 Description page for PDF Files is not visible / empty

? Any Hints ?

THX, Heinz

[edit] Needs Updating

This page is very un-clear about what the default values are for recent versions of the software.

Say you want to enable *.mp3 or *.mov files for uploading, simply add something like:
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'mp3', 'pdf', 'doc', 'mov', 'zip')
and make sure no other extension lines oppose that (such as $wgStrictFileExtensions, both on true and false) and that will work. It works fine for me anyway :) --87.69.58.71 12:15, 28 October 2006 (UTC)

[edit] Old defaults

The default settings listed for old versions are correct, contrary to the recent edit summary by Hoggwild5. You may have all the old versions of MediaWiki, but you clearly haven't looked at them (just one example). Perhaps if you have some spare time you could check out more recent versions and fill in the defaults, as per the above request. --HappyDog 23:18, 12 June 2007 (UTC)

No need to get nasty. I have no problem owning errors, but you don't have to publicly thrash someone -- it's really uncalled for. Thanks for pointing this out. My bad. --Hoggwild5 19:47, 14 December 2007 (UTC)
It wasn't intended to be nasty. I have manually checked all versions up to 1.8.0, and the values that I put back were correct up to that point. Your changes were not. Now someone else has messed with the defaults - I don't have time to fix it right now, but I will do soon (as well as getting it up to date). It is also important to keep previous versions, so perhaps the current setting is correct for 1.12, but in either case the old values should not be deleted. My comment was to back up my reversion of your edits, as otherwise there would have been no explanation for changing something that was stated to be manually checked. --HappyDog 11:46, 17 December 2007 (UTC)
Whatever the reason for your comments, there are constructive ways to deliver criticism, and then there are other ways. I have no problem with constructive criticism. --Hoggwild5 15:13, 17 December 2007
I'm sorry, but I don't see how my comment was anything other than constructive! I corrected your mistake, I directed you to a link for more information about why it was a mistake, and pointed out some other work that needed doing in case you were interested in helping further. What more could I do than that? --HappyDog 16:06, 17 December 2007 (UTC)
Look, we're just going to have to agree to disagree here. I do not view the criticisms you delivered as constructive given the manner in which they were delivered, but given that you have links on your talk page to "nasty stuff", I think you're probably already aware of that. Going forward, you might want to think about using a variation of the "7 second rule" before you post. Thanks! --Hoggwild5 22:46, 17 December 2007 (UTC)
If you want to view them that way, that's fine. That wasn't how they were meant and I'm sorry that you take offence that easily. --HappyDog 23:09, 17 December 2007 (UTC) btw - please take the 'nasty stuff' link in context... there is an element of cheek-tonguing going on there... :)

[edit] What file is this variable in?

Which file is this variable located in? LocalSettings.php?

All configuration options go into LocalSettings.php. That doesn't mean all are there from the start. But you can add them. See Manual:LocalSettings.php and Manual:Configuration settings -- Duesentrieb 21:37, 24 October 2007 (UTC)

[edit] Cannot delete pdf files

After allowing upload of pdf files i am not able to delete them.

A database error has occurred Query: INSERT INTO filearchive  (fa_storage_group,fa_storage_key,fa_deleted_user,fa_deleted_timestamp,fa_deleted_reason,fa_deleted,fa_name,fa_archive_name,fa_size,fa_width,fa_height,fa_metadata,fa_bits,fa_media_type,fa_major_mime,fa_minor_mime,fa_description,fa_user,fa_user_text,fa_timestamp)  SELECT 'deleted',IF(img_sha1=, , CONCAT(img_sha1,'.pdf')),'1','2008-01-10 09:17:04  GMT',,0,img_name,NULL,img_size,img_width,img_height,img_metadata,img_bits,img_media_type,img_major_mime,img_minor_mime,img_description,img_user,img_user_text,img_timestamp  FROM image WHERE img_name = 'Helpdesk.pdf' Function: LocalFileDeleteBatch::doDBInserts Error: 1 ERROR: function concat(text, "unknown") does not exist HINT: No  function matches the given name and argument types. You may need to add explicit type casts.

Backtrace:

#0 /srv/www/ipwiki.ip.tdk.dk/includes/Database.php(779): DatabasePostgres->reportQueryError('ERROR: functio...', 1, 'INSERT INTO fi...', 'LocalFileDelete...', false)
#1 /srv/www/ipwiki.ip.tdk.dk/includes/Database.php(1845): Database->query('INSERT INTO fi...', 'LocalFileDelete...')
#2 /srv/www/ipwiki.ip.tdk.dk/includes/filerepo/LocalFile.php(1216): Database->insertSelect('filearchive', 'image', Array, Array, 'LocalFileDelete...')
#3 /srv/www/ipwiki.ip.tdk.dk/includes/filerepo/LocalFile.php(1297): LocalFileDeleteBatch->doDBInserts()
#4 /srv/www/ipwiki.ip.tdk.dk/includes/filerepo/LocalFile.php(873): LocalFileDeleteBatch->execute()
#5 /srv/www/ipwiki.ip.tdk.dk/includes/FileDeleteForm.php(75): LocalFile->delete()
#6 /srv/www/ipwiki.ip.tdk.dk/includes/ImagePage.php(491): FileDeleteForm->execute()
#7 /srv/www/ipwiki.ip.tdk.dk/includes/Wiki.php(397): ImagePage->delete()
#8 /srv/www/ipwiki.ip.tdk.dk/includes/Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#9 /srv/www/ipwiki.ip.tdk.dk/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#10 /srv/www/ipwiki.ip.tdk.dk/index.php5(1): require('/srv/www/ipwiki...')
#11 {main}

If i try to nuke:

php maintenance/nukePage.php "Billede:Helpdesk.pdf"
Erase Page Record

Searching for "Billede:Helpdesk.pdf"...PHP Warning:  pg_query(): Query failed: ERROR:  relation "page" does not exist in /srv/www/ipwiki.ip.tdk.dk/includes/DatabasePostgres.php on line 506
A database error has occurred
Query: SELECT  page_id  FROM page  WHERE page_namespace = '6' AND page_title = 'Helpdesk.pdf'  LIMIT 1  
Function: LinkCache::addLinkObj
Error: 1 ERROR:  relation "page" does not exist

Backtrace:
#0 /srv/www/ipwiki.ip.tdk.dk/includes/Database.php(779): DatabasePostgres->reportQueryError('ERROR:  relatio...', 1, 'SELECT  page_id...', 'LinkCache::addL...', false)
#1 /srv/www/ipwiki.ip.tdk.dk/includes/Database.php(1224): Database->query('SELECT  page_id...', 'LinkCache::addL...')
#2 /srv/www/ipwiki.ip.tdk.dk/includes/Database.php(1104): Database->select('page', 'page_id', Array, 'LinkCache::addL...', Array)
#3 /srv/www/ipwiki.ip.tdk.dk/includes/LinkCache.php(146): Database->selectField('page', 'page_id', Array, 'LinkCache::addL...', Array)
#4 /srv/www/ipwiki.ip.tdk.dk/includes/Title.php(1655): LinkCache->addLinkObj(Object(Title))
#5 /srv/www/ipwiki.ip.tdk.dk/maintenance/nukePage.inc(25): Title->getArticleID()
#6 /srv/www/ipwiki.ip.tdk.dk/maintenance/nukePage.php(17): NukePage('Billede:Helpdes...', true)
#7 {main}

Can you help? My Mediawiki version is 1.11.0 I am using PostgreSQL 8.1.5 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)

You may reply on tcj(at)tdc.dk Replace (at) with @

[edit] Case sensitive?

I got a list of extensions from a project manager, put them into array format and put them in the config. They were uppercase and I didn't think anything of it, until uploading '.pdf' didn't work, but '.PDF' did. I changed them all to lower case and now can upload both .pdf and .PDF. It might be worth a mention in the documentation though. --Cm 12:45, 6 November 2009 (UTC)

[edit] $wgextension default not an array, perhaps doesn't exist sometimes, limits choices of methods

I'm using MW 1.15.1. After adding the line

$wgFileExtensions = array_merge( $wgFileExtensions, array( 'pdf', 'svg' ) );

to my LocalSettings.php file, I sometimes got the PHP error:

Warning: array_merge()...Argument #1 is not an array...

There is no other instance of $wgFileExtensions in my LocalSettings file, and I put it near the end of the file. So, on some pageloads, it appears that the code doesn't declare the array. Therefore, it is not proper to use the arraymerge method listed on this help page. Instead, we should use the PHP method that works either way:

$wgFileExtensions[] = 'pdf';

-- (shawn) 66.67.97.102 18:50, 17 December 2009 (UTC)

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox