I am trying to automate uploading images (or files). We are currently using mediaWiki
version 1.13.2.
I am using the following code:
$data=array( 'wpIgnoreWarning'=>'1',
'wpDestFile'=>="$bulkImageDirectory/$fname",
'wpReUpload'=>'1',
'wpUpload'=>'1',
'wpUploadFile'=>$fname,
);
$webrequest=new FauxRequest( $data, true );
$uploader=new UploadForm( $webrequest );
$uploader->mUploadSize=$zipfile['size'];
$uploader->mUploadTempName="$bulkImageDirectory/$fname";
$uploader->mOname=$fname;
$uploader->mSessionKey='1';
$uploader->processUpload();
$fname is a relative file name, while ="$bulkImageDirectory/$fname" is the
absolute file name. The file is located in wiki/images/tmp/bulkImages/.
I receive 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." And
the upload form displays on the screen with wpDestFile filled in.
Three questions:
Do you know what the problem is?
Is there another way to automatically upload a file within an extension?
Is there documentation on this?
Thanks,
Mary Beebe