Download the PHP package mediawiki/simple-batch-upload without Composer
On this page you can find all versions of the php package mediawiki/simple-batch-upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mediawiki/simple-batch-upload
More information about mediawiki/simple-batch-upload
Files in mediawiki/simple-batch-upload
Package simple-batch-upload
Short Description Basic, no-frills uploading of multiple files to MediaWiki
License GPL-2.0-or-later
Homepage https://professional.wiki/en/extension/simplebatchupload
Informations about the package simple-batch-upload
SimpleBatchUpload
The SimpleBatchUpload extension provides basic, no-frills uploading of multiple files to MediaWiki.
It is maintained by Professional Wiki. Contact us for commercial support or MediaWiki development.
Requirements
- PHP 8.0 or later
- MediaWiki 1.43 or later
Use SimpleBatchUpload 2.x for older versions
Installation
Composer
Manual installation
Download and place the files in a directory called SimpleBatchUpload in your extensions/ folder.
Enable the extension by adding the following to your LocalSettings.php:
Usage
See the SimpleBatchUpload usage documentation.
Customization
Text on MediaWiki:Batchupload-summary is shown at the top of Special:BatchUpload and its subpages.
It is possible to specify dedicated parameter sets for the upload of specific file types by editing the MediaWiki:Simplebatchupload-parameters page. Each line of that page is considered as one set of parameters.
Available parameters are:
- Name of template to be stored as text on initial upload
- Upload comment
- Title line of the Special:BatchUpload page
Parameters should be separated by pipes (|).
The line to be used is selected by appending the name of the template as the subpage to the URL of the Special:BatchUpload page.
Example:
Consider the parameter line
- This can be selected by going to Special:BatchUpload/Pics.
- The title of this page will be Upload some pics!.
- The comment for the upload will be These pics were uploaded using [[mw:Extension:SimpleBatchUpload{{!}}SimpleBatchUpload]].
- If a file with that name is uploaded for the first time it will have
{{Pics}}as wikitext. - Both can be changed under Edit details before Upload is pressed: the wikitext as File page text, the comment as Summary.
Renaming files on upload
Select Edit details above the file list; Rename files is in the form it opens. Each row shows the name its file will be uploaded under before Upload is pressed.
| To | Find | Replace with | Use regular expressions | IMG_0001.jpeg uploads as |
|---|---|---|---|---|
| Add a prefix | Trip- |
no | Trip-IMG_0001.jpeg |
|
| Replace text | IMG_ |
Trip- |
no | Trip-0001.jpeg |
| Change the extension | \.jpeg$ |
.jpg |
yes | IMG_0001.jpg |
| Keep part of the name | ^IMG_(\d+) |
Trip-$1 |
yes | Trip-0001.jpeg |
- An empty Find puts Replace with in front of the name.
- Plain text replaces every occurrence, matching case, and never changes the file extension.
- A regular expression searches the whole name, extension included, and
replaces every match. In Replace with,
$1stands for the first(...)group, along with the rest of JavaScript's replacement syntax. - Files that end up sharing a name wait on their rows for a choice.
- A name left without an extension is marked on its row. The file is still sent, and the wiki adds an extension from what the file turns out to be.
A rule from the page
A +rename parameter fills in the fields when the page opens, with Use regular
expressions ticked. The uploader can still change them. Here Pics names the
template every uploaded file's page contains:
| Part | In the example | Written as |
|---|---|---|
| Delimiters | / |
#, /, @ or !; use one that is not in the pattern |
| Pattern | ^IMG_(\d+) |
A regular expression |
| Flags | none | Any of g, i, m, u and y, right after the closing delimiter. Without g only the first match is replaced, even after Find or Replace with is edited |
| Replacement | Trip-$1 |
Everything after -->, spaces included |
- A rule containing
|goes inside<nowiki>whole:+rename = <nowiki>/IMG_|DSC_/-->Trip-</nowiki>. - A rule not written this way renames nothing, and the upload area says so.
- The parameter is not passed to the template.
- A parameter line on MediaWiki:Simplebatchupload-parameters cannot set a
rule, and a
+renametyped into File page text is published as written.
Uploading files as they are added
Files added to this upload area start uploading straight away, without Upload being pressed.
Configuration
Available configuration options:
$wgSimpleBatchUploadMaxFilesPerBatch- Array defining the maximum number of files that can be uploaded each time depending on the user group.
Default:
Note: Be aware that this is not the right setting to completely block file uploads! Users can still use the normal file upload or the MediaWiki API. See the paragraph on user permissions on Configuring file uploads on mediawiki.org.
License
GNU General Public License 2.0 or later