Extension talk:UploadLocal/Archive

From MediaWiki.org
Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).


test w/ 1.8.2, work! — Preceding unsigned comment added by Mihu (talkcontribs) 22:41, 14 December 2006

Fatal error

I got always the problem that my browser won't start the wiki anymore with this message:

Fatal error: Undefined class name 'specialpage'

Any ideas? Is it my fault?


Gerrit — Preceding unsigned comment added by (talkcontribs) 10:22, 20 December 2006

one tiny suggestion

This works out great. Thank you. It is exactly what I was looking for!

One tiny thing I can think of is the warnings (before overwriting any files with same names, etc).

Because a batch of files are being uploaded you want to make sure that youre not messing up any other articles.

I wonder if this is an already existing option here that im not seeing.. — Preceding unsigned comment added by (talkcontribs) 01:36, 18 January 2007

Other suggestion

Thank you for your work.

I think it's better to put the second file in the extensions directory instead of the include one and write on the first file on line 48 :

SpecialPage::addPage( new SpecialPage( 'UploadLocal', 'uploadlocal',true,"wfSpecialUploadLocal","extensions/SpecialUploadClass.php" ) );

Epommate 15:01, 26 January 2007 (UTC)


before i install and try this out - does it allow you to specify the page content and license for the images? — Preceding unsigned comment added by (talkcontribs) 12:51, 26 July 2007

Removing Permissions

Is there any way to get this feature to work like Special:Upload, in that it only checks for membership before allowing the page to be used? I've switched to using IpbWiki, which handles permissions differently, and can't figure out how to make the two work together.

— Preceding unsigned comment added by (talkcontribs) 23:52, 28 July 2007


This is EXACTLY what I have. I have over 1 gig of audio files that I really don't want to upload again. I followed the steps exactly as described, but it stills ays that "Special:UploadLocal" is an undefined special page.

Any ideas? Hints? Help.... :S



— Preceding unsigned comment added by SimeonArgus (talkcontribs) 03:44, 8 October 2007

Hacky Fix for 1.11

Overwrite the UploadLocalForm class constructor with this:

function UploadLocalForm($filename, $description, $watch, $dest) {
        global $wgUploadLocalDirectory;
        $this->mDesiredDestName = $dest;
        $this->mIgnoreWarning = true; //ignore warnings... don't wanna deal with 'em
                                      //however, this attitude means that it's
                                      //extremely easy to accidently overwrite
                                      //files. Solution?
        $this->mComment = $description;
		$this->mReUpload    = true;
        $this->mUploadClicked = true;
        $this->mLicense = ''; //not supported yet
        $this->mCopyrightStatus = ''; //not supported yet
        $this->mCopyrightSource = ''; //not supported yet
        $this->mWatchthis = $watch;
		$this->mSourceType        = '';
		$this->mDestWarningAck    = 'true';
		$this->mAction            = 'submit';
        $this->mSessionKey = true; //makes it think that it is locally stored
        $this->_filename = $filename;
        $directory = $wgUploadLocalDirectory;
        if ($directory[strlen($directory)-1] !== '/') $directory .= '/';
    	$this->mTempPath         = $directory . $filename;
    	$this->mFileSize         = filesize($this->mTempPath);
    	$this->mSrcName          = $directory . $filename;
    	$this->mFileProps        = '';
    	$this->mCurlError        = 0/*UPLOAD_ERR_OK*/;
    	$this->mStashed          = false;
    	$this->mRemoveTempFile   = false;

— Preceding unsigned comment added by (talkcontribs) 20:16, 6 November 2007

These problems have been fixed in the latest release. Upgrade upgrade! — Edward Z. Yang(Talk) 23:47, 9 February 2008 (UTC)
I have the newest version and it does not work on 1.7.1 mediawiki, I get the error:
"The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file."
I simply installed the older version again, and it works fine...thank you edward!
Odessaukrain 01:17, 9 May 2008 (UTC)

You did not upload any files.

I installed the extension complied with the procedure, however, I have this error message. Yet I see files.

Why? — Preceding unsigned comment added by (talkcontribs) 08:35, 9 January 2008

Hi, it is likely that you are running an older version of MediaWiki. The most recent version of this extension is only known to work with 1.11. — Edward Z. Yang(Talk) 23:38, 9 May 2008 (UTC)

Problems with mediawiki version 1.11

After upgrading to mediawiki 1.11 every attempt to upload files with UploadLocal ends with

The file you uploaded seems to be empty. 
This might be due to a typo in the file name. 
Please check whether you really want to upload this file.

Does anybody experience the same problems?

Kind regards

Albert Cremer 17:15, 14 January 2008 — Preceding unsigned comment added by (talkcontribs)

Those who can read have a clear advantage over others;-) => The fix mentioned above solves the problem 08:47, 15 January 2008 — Preceding unsigned comment added by (talkcontribs)

Some files had errors

I am trying to upload a bunch of jpg images. When I run the tool I get these error messages:

Some files had errors
- (Translated) The uploaded file appears to be empty. This could be a typo in the filename. Please check the file.

After changing the class constructor:

Some files had errors
DSLMDB02099.jpg - (Translated) The uploaded file appears to be empty. This could be a typo in the filename. Please check the file.
DSLMDB02100.jpg - (Translated) The uploaded file appears to be empty. This could be a typo in the filename. Please check the file.
... etc.


   * MediaWiki: 1.9.3
   * PHP: 5.2.3 (apache)
   * MySQL: 5.0.51a 

Is there a solution for this problem?

Kind regards,

Melvin Rook — Preceding unsigned comment added by (talkcontribs) 10:18, 21 March 2008

Hi, the best solution is to use MediaWiki 1.11, otherwise, use an older version of the extension. — Edward Z. Yang(Talk) 23:39, 9 May 2008 (UTC)


Hi, i have the below error even after i installed Hacky Fix for 1.11 My Pictures.zip :

"The file you uploaded seems to be empty. This might be due to a typo in the file name. Please check whether you really want to upload this file."

Can any one help me? — Preceding unsigned comment added by (talkcontribs) 15:57, 1 May 2008

Same problem here. — Preceding unsigned comment added by (talkcontribs)
Me too. I have mediawiki 1.7. I simply installed the older version of this program (look at the September 2007 history on the main page), and it works fine...thank you edward for the great program!Odessaukrain 00:55, 9 May 2008 (UTC)

french translation

Hi, I have translated this extension in french so I put it there if anyone need it

$messages = array(
       'uploadlocal' => 'Envoyer des fichiers',
       'uploadlocal_directory_readonly' => 'Le dossier d\'envoi local ($1) n\'est '.
       ' pas accessible en ecriture sur le serveur.',
       'uploadlocaltext' => 'Utilisez ce formulaire pour envoyer des fichiers qui sont déjà'.
       ' dans le dossier du serveur. Vous pouvez en apprendre plus en allant sur'.
       '  La page d\'envoi classique',
       'uploadlocalbtn' => 'Envoyer des fichiers locaux',
       'nolocalfiles' => 'Il n\'y a pas de fichiers dans le dossier.'.
       ' essayez d\en mettre dans "$1."',
       'uploadednolocalfiles' => 'Vous n\'avez pas envoyé de fichiers.',
       'allfilessuccessful' => 'Tout les fichiers ont bien été envoyés',
       'uploadlocalerrors' => 'Certains fichiers ont eu des erreurs',
       'allfilessuccessfultext' => 'Tous les fichiers ont bien été envoyés.Retourné à'.
       ' Accueil.',
       'uploadlocal_descriptions_append' => 'Après la description : ',
       'uploadlocal_descriptions_prepend' => 'Avant la description : ',
       'uploadlocal_dest_file_append' => 'Après le nom des fichiers : ',
       'uploadlocal_dest_file_prepend' => 'Avant le nom des fichiers : ',
       'uploadlocal_file_list' => 'Fichiers prêt à être envoyés',
       'uploadlocal_file_list_explanation' => '\'\'\'X\'\'\' indique'.
       '  si le fichiers doit être envoyé. '.
       '  \'\'\'W\'\'\' indique si vous souhaitez avoir le fichier dans votre liste de suivi',
       'uploadlocal_global_params' => 'Parametères globaux',
       'uploadlocal_global_params_explanation' => 'Ce qui est rentré ici sera ajouter soit au 

début soit a la fin de la description et/ou du nom de fichier'


-- 17:31, 4 July 2008 (UTC)

Blank page

When I navigate to Special:UploadLocal a blank page shows up. I did the hacky fix, I didn't change the default directory, I have the right permission, what is my problem?

I solved it, but if anyone has the same problem, at line three of /extensions/SpecialUploadLocal/UploadLocalForm.php i put require_once 'extensions/SpecialUploadLocal/SpecialUploadLocal.php'; instead of the default generated text that was saying require_once('SpecialUpload.php');

Rename Problem

I am getting this error, any suggestions?

Could not rename file "$IP/extensions/SpecialUploadLocal/data/Filename.jpg" to "public/c/c2/Filename.jpg".

You did not upload any file

when i attemp to upload some files i get this type of error and any of myfiles was upload.

does somebody help me?

Problem with file ownership

When using this extension with files not uploaded through the webserver somehow, and stored in a way that the webserver doesn't have ownership, this extension gives

Warning: chmod() [function.chmod]: Operation not permitted in /usr/share/mediawiki/includes/filerepo/FSRepo.php on line 347

during processing of the file list.

Mediawiki 1.13 - Failed opening required 'SpecialUpload.php'

See title. The extension tries to include SpecialUpload.php, and I don't know if I'm doing anything wrong, but it's not in the default include paths for me. Thus the include statement has to be changed to


though there is probably a better way for this. The MediaWiki team changed the extension loading mechanism lately so that you only would have to load the bare minimum of things needed if you use the proper hooks. I think this extension now always includes the file, even if the functionality isn't needed at all.

Fix for 1.13 and some modifications

To make it work in 1.13:

Replace in UploadLocalForm.php





Also I add a functionality to replace only small pictures (width < 250px). May be it would be useful for someone:

In file UploadLocalDirectory.php Insert after

foreach($forms as $key => $value) {

following code:

$img = wfFindFile( $forms[$key]->mDesiredDestName );
if ($img)
   $width = $img->getWidth();
   if ($width >= 250)

Hope it helps. =)

ZF Turbo 08:22, 28 November 2008 (UTC)

I desperately needed this extension to work on a private MW 1.14 I manage. After I had checked the error log of the web server and found out that the extension searches the file SpecialUpload.php at the wrong directory, I came to the same workaround as you had a year ago. I've added the workaround to the extension page, so the next one who needs it, won't have to search too far. Dolev 19:30, 3 December 2009 (UTC)

Not a valid special page

Hi, using the trunk version of MW and this extension is not showing up as a valid special page. Promethean 04:40, 13 December 2008 (UTC)

Incompatible with 1.16 alpha

Due to MessageCache::addMessages not being there. – Nikerabbit 15:10, 29 June 2009 (UTC)

Nor 1.15.0

Seems to break on MW 1.15.0. --Bsmithme 01:55, 4 July 2009 (UTC)

same here with 1.15.4 --15:20, 6 July 2010 (UTC)

Warning for overwrite

Great extension. Works fine for me with 1.15.4. Only shortcoming is the lack of warning for files already existing (it generates another version) 18:16, 17 July 2010 (UTC)

Transfer to 1.16.0

This extension does not work with 1.16.

Firstly, with "require_once('specials/SpecialUpload.php');" fixed, the words in the form are replaced by "<word>". "$wgMessageCache->addMessages($messages);" no more works; instead, it can be easily converted to an i18n file. The form shows right, however, error occurs when submitting the files.

PHP Fatal error: Call to undefined method UploadForm::uploadform() in ...\extensions\SpecialUploadLocal\UploadLocalForm.php on line 33

In 1.15, there is only a includes/specials/SpecialUpload.php (59KB) for uploading. These is a mere class, UploadForm, mentioned in SpecialUpload.php.

|-class UploadForm
| |-function UploadForm( &$request )
| |-function processUpload() 

In 1.16, includes/specials/SpecialUpload.php is resized to 32KB and an includes/upload directory is established with 4 files. Classes are more complex.

|-class SpecialUpload extends SpecialPage
| |-protected function loadRequest( $request )
|-class UploadForm extends HTMLForm
|-class UploadSourceField extends HTMLTextField
|-abstract class UploadBase
|-class UploadFromFile extends UploadBase
| |-function initializeFromRequest( &$request )

It is nearly impossible to make an extension for both 1.15 and 1.16. We need a new extension especially for 1.16. --Zayoo 13:22, 3 September 2010 (UTC)

It's too difficult to make it work in 1.16. I've given up trying and install another 1.14 just for uploading. --Zayoo 19:21, 3 September 2010 (UTC)
So you mean you will over write your 1.16 for 1.14? Or will you have two versions of mediawiki? Adamtheclown 08:03, 15 November 2010 (UTC)
I just run both 1.16 and 1.14 in different directories but sharing the same database. I install 1.14 with another database, then change it to 1.16's database so it's harmless. After uploading in 1.14 with SpecialUploadLocal, I merge all the files in /images/ to 1.16's.--Zayoo 13:18, 21 November 2010 (UTC)

Need a 1.16 version

main SpecialUploadLocal page works

By making the changes required for Mediawiki.1.13 to 1.15 I was able to get to the main page.

But when I press the upload local files button, I get the same error as Zayoo:

Fatal error: Call to undefined method UploadForm::UploadForm() in /home/content/c/2/o...extensions/SpecialUploadLocal/UploadLocalForm.php on line 33

Line 33 of UploadLocalForm.php is:


I emailed and messaged the creator: User talk:Edward Z. Yang asking for a newer version.

Adamtheclown 07:59, 15 November 2010 (UTC)

Have you tried the using the importImages.php maintenance script instead? If you don't have shell access, you still should be able to run it with Extension:MaintenanceShell. —Emufarmers(T|C) 15:58, 15 November 2010 (UTC)
I emailed creator User talk:Edward Z. Yang. He was not nice enough to respond. English is obviously his second language:
"Unfortunately I'm no longer SpecialUploadLocal, so there's not really a self-scratch fulfilled by updating the extension. Sorry. :-("
I think this means an update will not happen.
20 days, dozen of hours, still unable to get a program to work which will upload multiple files to my wiki. Damn. Adamtheclown 05:54, 22 November 2010 (UTC)

Hello all, sorry about the long delay in responding. It’s been a while since I last visited MediaWiki.org, I didn't even realize I had new messages. I haven't looked at the API changes for 1.16, but judging from the inability of the general public to figure out a hack around it, it looks like the changes are pretty substantial and may require a mini-rewrite of ``UploadLocalForm.php``, which was always a bit of a hack and quite frankly I'm surprised it kept working this long. I'll try to take a look at it after exams. — Edward Z. Yang(Talk) 10:57, 22 May 2011 (UTC)

failed to open stream: No such file or directory

I paid $65 to get mediawiki 1.15.5 installed. Now I get this error message when I type in Special:UploadLocal:

Warning: require_once(SpecialUpload.php) [function.require-once]: failed to open stream: 
No such file or directory in /home/content/c/2/o/c2/html/dr/extensions/SpecialUploadLocal/UploadLocalForm.php on 
line 3

Fatal error: require_once() [function.require]: Failed opening required 
'SpecialUpload.php' (include_path='/home/content/c/2/o/c2/html/dr:/home/content/
in /home/content/c/2/o/c2/html/dr/extensions/SpecialUploadLocal/UploadLocalForm.php on line 3

Adamtheclown 22:14, 22 November 2010 (UTC)

Ah figured it out:
I need to make sure the required modifications are working:
Extension:SpecialUploadLocal#Required_modification for_MediaWiki_1.13_to_1.15
Adamtheclown 22:28, 22 November 2010 (UTC)

Comments when the folder is empty

Here are the comments when the folder is empty:

Use this form to mass upload files already on the server in the upload local directory. 
You can find out more general information at the regular upload file page.

There are no files in the local upload folder. Try placing some files in 

Adamtheclown 22:29, 22 November 2010 (UTC)

Error message

The upload directory (/home/t/public_html/deadwiki.com/public/images) is not writable by the webserver. 

Adamtheclown 01:02, 30 November 2010 (UTC)

problem was permission. need to change chmod permission. the person helping me did it with putty, but right clicking the folder in an FTP program like winSCP may work also. Adamtheclown 02:37, 30 November 2010 (UTC)

and I'm getting this message

Fatal error: Call to undefined method UploadForm::UploadForm() in /home/teach12/public_html/wasteforlife/wiki/extensions/SpecialUploadLocal/UploadLocalForm.php on line 33

Any idea what I should do?

.filepart files are not downloaded

Every time I download with Extension:SpecialUploadLocal one file has .filepart.

This file does not upload.


The file is listed as Dead_rising_2_case_0_broadsword_mommas_diner_above_(9).png.filepart.

Dead_rising_2_case_0_broadsword_mommas_diner_above_(9).png NOT listed

Dead_rising_2_case_0_broadsword_mommas_diner_above_(9).png is not listed in uploaded files. Searching for this file, there are not results.

Work around

.filepart in File:Dead_rising_2_case_0_bobs_running_across_roof_(10).png

Unchecked this file and upload remaining files.


Next time I visited Special:UploadLocal, File:Dead_rising_2_case_0_bobs_running_across_roof_(10).png did not have .filepart in the file name.

But File:Dead_rising_2_case_0_bobs_running_across_roof_(13).png did.

File:Dead_rising_2_case_0_bobs_running_across_roof_(10).png then uploaded okay.

.filepart is not found in three specialuploadlocal files.

Adamtheclown 02:51, 30 November 2010 (UTC)

Changes in 1.16.1

The release notes for MediaWiki 1.16.1 say that one of the changes is "(bug 24981) Allow extensions to access SpecialUpload variables again".

Does anybody know whether this means that SpecialUploadLocal might work under 1.16.1, perhaps with some of the changes suggested above? I am still running 1.14 specifically so that SpecialUploadLocal still works, and I don't know how to install 1.16.1 separately just to see whether the extension works or not.-- 13:23, 6 January 2011 (UTC)

Tested SpecialUploadLocal unchanged with Mediawiki 1.16.1: Works as expected. 17:08, 7 January 2011 (UTC)
When you say "as expected," do you mean that it actually worked? I tried running with 1.16.1 and it gave me the same issues. I took a look at Extension:MultiUpload to see if I could put two and two together to fix the variables but wound up just being frustrated and impotent. - 19:55, 23 January 2011 (UTC)

I've just tested with 1.16.1 and I can comcirm that it's still broken. The interface works but when you press the button to upload the file you end up with a white page. (PHP error)

I work with 1.16.5, and very sadly get the same white page ... anyone having a solution :( It would be a great tool. -- 23:22, 11 June 2011 (UTC)

1.16.5 fix will be very appreciated!!!

Working in 1.18

Hi, I just saw cneubauer updated the repository and it is working in MW 1.18. Thanks a lot! ~ Seb35 13:47, 11 December 2011 (UTC)

Thank you for your note. I just updated the extension's page. I guess still catering for versions < MW 1.17. is not advisable since it appeard to be a mess. Cheers --[[kgh]] 14:12, 11 December 2011 (UTC)