Extension:MsUpload

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
MsUpload
Release status: beta
Msupload version 1.27 with wikieditor.png
Implementation Ajax, API
Description Allows to upload multiple files via the editor including drag & drop
Author(s) Martin Schwindl, Martin Keyler and Felipe Schenone
Latest version 13.1 (2016-10-25)
MediaWiki 1.26+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
  • $wgMSU_showAutoCat
  • $wgMSU_checkAutoCat
  • $wgMSU_imgParams
  • $wgMSU_useDragDrop
  • $wgMSU_useMsLinks
  • $wgMSU_confirmReplace
  • $wgMSU_uploadsize
Translate the MsUpload extension if it is available at translatewiki.net
Check usage and version matrix.
Issues Open tasks · Report a bug

The MsUpload extension allows users to upload multiple files by drag & drop in the standard MediaWiki edit page.

Features
  • Easily upload one or multiple files simultaneously.
  • File upload integrated in the edit page.
  • Upload via drag and drop (if HTML5 is available in browser).
  • Add the file into the edit page as a link.
  • Add the files into the edit page as a gallery.
  • Change the name of the file before uploading.
  • Add files to the current category, if the page being edited is a category page.

Installation[edit]

  • Download and place the file(s) in a directory called MsUpload in your extensions/ folder.
MediaWiki versions earlier than 1.25 or problems with version 1.27
See Known issues below.

Configuration[edit]

An editor can embed the files into the editor as a list of MsLinks with Extension:MsLinks.

Extension features[edit]

Below are the special extension features that you can set in your LocalSettings.php :

$wgMSU_useDragDrop = true; // Should the drag & drop area be shown? (Not set by default)
$wgMSU_showAutoCat = true; // Files uploaded while editing a category page will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for adding a category to a page is checked by default
$wgMSU_useMsLinks = false; // Insert links in Extension:MsLinks style?
$wgMSU_confirmReplace = true; // Show the "Replace file?" checkbox
$wgMSU_imgParams = 'thumb|none'; // Any image parameter separated by a semicolon. Examples are: {width}px, left, right, center, none, border, frameless, frame, thumb etc etc

Relevant global configuration variables[edit]

Below are some of the relevant global configuration variables that you can set in your LocalSettings.php :

$wgEnableWriteAPI = true; // Enable the API
$wgEnableUploads = true; // Enable uploads
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
$wgGroupPermissions['user']['upload'] = true; // Allow regular users to upload files
// Make sure that the file types you want to upload are allowed:
$wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','pdf','ppt','tiff','bmp','docx','xlsx','pptx');

Configuration with PdfHandler[edit]

Extension:PdfHandler allows an editor upload PDF files and automatically generates thumbnails and image files.

MsUpload can add images to a page. However, MsUpload does not allow PDFs to be displayed as images. To add images to a page, edit the MsUpload.js file. Search for switch in the file and add the line case 'pdf': to it.

Recent changes[edit]

Known issues[edit]

Installing an earlier version of MsUpload[edit]

  • Mediawiki 1.25 and earlier: this extension no longer works.
[No solution]
  • Mediawiki 1.27 does not work with MsUpload 1.27, 1.28, 1.29.

Solution for Mediawiki 1.27:

(1) IMPORTANT If Extension:WikiEditor is enabled in Localsettings.php disable it.

(2) In Localsettings.php add two lines:

require_once "$IP/extensions/MsUpload/MsUpload.php";
#wfLoadExtension( 'MsUpload' );
The MsUpload Version 1.25, showing the green Clone or Download button and the Download Zip drop down menu.

(3) Download and install the 1.25 version of Extension:MsUpload on Github:

On the MsUpload/tree/REL1_25 page:
(a) Click the Clone or Download button
In the drop down menu, select the Download Zip button.
The Zip file mediawiki-extensions-MsUpload-REL1_25 will download to your desktop
(b) Open the Zip file mediawiki-extensions-MsUpload-REL1_25
(c) Download and place the files in the mediawiki-extensions-MsUpload-REL1_25 folder in a directory called MsUpload in your extensions/ folder.

Yes check.svg Done Navigate to Special:Version on your wiki to verify that MsUpload 1.25 is successfully installed.

You should know[edit]

  • Without HTML5 support Adobe Flash is used
  • The maximum file size depends on MediaWiki settings but a lower limit may be set.
  • Uses the plupload upload handler, which comes included with the extension
  • Adds an upload icon to the editor and WikiEditor.

This file did not pass file verification[edit]

If this appears: "This file did not pass file verification" add the following to LocalSettings.php

$wgAllowJavaUploads = true;

If this is not enough additionally set the following in LocalSettings.php (works for MW 22 & 24)

$wgVerifyMimeType = false;

If you still cannot upload "ppt" files, try to save them as "pptx" and upload the "pptx" version.

Invalid CSRF token[edit]

The Invalid CSRF token message means that your browser couldn't create a secure cookie, or couldn't access that cookie to authorize your login.

Google Chrome
Open Settings, Advanced, Privacy and security, Content Settings, Cookies, Allow, Add and enter e.g. [*.]yourwiki.domain, logout and login again to the wiki.
Firefox
Open Options, Privacy & Security, Cookies and Site Data, Exceptions, enter e.g. https://yourwiki.domain, Save Changes, logout and login again to the wiki.
Safari
Open Preferences, Privacy, ensure that Cookies and website data is set to allow, logout and login again to the wiki.
...

References[edit]

  1. Note that there is a plan to remove this dependency.

See also[edit]