Extension:MsUpload

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png
MsUpload

Release status:Extension status stable

MsUpload.jpg
ImplementationTemplate:Extension#type Ajax, API
DescriptionTemplate:Extension#description Allows to upload multiple files via the editor including drag & drop
Author(s)Template:Extension#username Martin Schwindl, Martin Keyler and Felipe Schenone
Latest versionTemplate:Extension#version 12.0 (2016-02-09)
MediaWikiTemplate:Extension#mediawiki 1.22+
PHPTemplate:Extension#php 5.3+
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license GNU General Public License 2.0 or later
Download
ParametersTemplate:Extension#parameters
  • $wgMSU_showAutoCat
  • $wgMSU_checkAutoCat
  • $wgMSU_imgParams
  • $wgMSU_useDragDrop
  • $wgMSU_useMsLinks
Hooks usedTemplate:Extension#hook
EditPage::showEditForm:initial

Translate the MsUpload extension if it is available at translatewiki.net

Check usage and version matrix.

The MsUpload extension allows users to upload multiple files from the edit interface, including by drag & drop files.

MsUpload functions
  • Allows user to easily upload one or multiple files simultaneously.
  • File upload integrated in the editor.
  • Upload via drag and drop (if HTML5 is available in browser).
  • Embed the file into the editor as a link.
  • Change the name of the file before uploading.
Additional functions
  • Add files to the current category
  • Embed the files into the editor as a list of MsLinks (you need Extension:MsLinks)
  • Embed the files into the editor as a gallery
You should know
  • Without HTML5 support Adobe Flash is used
  • The maximum filesize depends on Mediawiki settings but a higher limit may be set.
  • Uses the plupload upload handler, which comes included with the extension
  • Adds an upload icon to the editor and WikiEditor.

Installation[edit]

  • Download and place the file(s) in a directory called MsUpload in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
wfLoadExtension( 'MsUpload' );
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.24 or earlier:

The instructions above describe the new way of installing extensions using wfLoadExtension(), since MediaWiki 1.25. If you need to install this extension in earlier versions, instead of wfLoadExtension( 'MsUpload' );, you need to use:

require_once "$IP/extensions/MsUpload/MsUpload.php";

Configuration[edit]

Extension specific parameters[edit]

Below are the configuration variables of the extension that you can set in your LocalSettings.php, with their defaults:

$wgMSU_useDragDrop = true; // Should the drag & drop area be shown?
$wgMSU_showAutoCat = true; // If true, files uploaded while editing a category will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for the above mentioned case is checked by default
$wgMSU_useMsLinks = false; // Should we allow to insert links in the style of the Extension:MsLinks?
$wgMSU_confirmReplace = true; // Show the "Replace file?" checkbox
$wgMSU_imgParams = '400px'; // The default parameters for inserted images

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 to upload PDF files and automatically generates thumbnails and image files. MsUpload offers to include images to a page. However, MsUpload does not allow PDFs to be displayed as images. In order to enable this edit the MsUpload.js file, search for switch and add case 'pdf': to it.

Recent changes[edit]

Animated example of drag and drop
Version 10.0
  • Code structure and style updated to 2014 standards
  • Bugfixing
Version 9.5.1
  • Bugfixing
Version 9.5
  • Image preview
  • Improved CheckFiles function
  • Bug-fixing ie8
  • File instead of Image for gallery
  • Old sajax functions replaced by $.ajax/$.get
  • Removed function SpecialUpload::ajaxGetExistsWarning replaced by API request
  • Plupload 2.0 implemented
  • Lithuanian language (Vitas Povilaitis)
  • Hebrew language (JNF)
  • French language (Marc MORA)
Version 9.4
  • Drop-Zone can be disabled in LocalSettings
  • An image-thumbnail will be displayed after upload
  • Mediawiki-API for text-insertion is used
  • Clear-all link added (remove all uploaded files from list)
Version 9.3
  • Bug-Fix IE
  • Tested in mw1.20.2
  • Plupload 1.5.5
  • Japanese language (Kouichi Nishizawa)
  • Italian language (teokraba)
  • Spanish language (Hernan Hegykozi)
  • New upload icon

Known issues[edit]

When this shows up: "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.

See also[edit]