Allows for basic, no-frills uploading of multiple files
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
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].
• PHP 8.0 or later
• MediaWiki 1.43 or later
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:
See the SimpleBatchUpload usage documentation.
Text on MediaWiki:Batchupload-summary is shown at the top of
Special:BatchUpload and its subpages.查看完整 README ↗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.
Use SimpleBatchUpload 2.x for older versions
COMPOSER=composer.local.json composer require --no-update mediawiki/simple-batch-upload:^4.0
composer update mediawiki/simple-batch-upload --no-dev -o
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:
wfLoadExtension( 'SimpleBatchUpload' );
See the SimpleBatchUpload usage documentation.
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:
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
Pics | These pics were uploaded using [[mw:Extension:SimpleBatchUpload{{!}}SimpleBatchUpload]] | Upload some pics!
{{Pics}} as wikitext.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 |
$1 stands for the first (...)
group, along with the rest of
JavaScript's replacement syntax.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:
{{#batchupload:Pics|+rename = /^IMG_(\d+)/-->Trip-$1}}
| 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 |
| goes inside <nowiki> whole:
+rename = <nowiki>/IMG_|DSC_/-->Trip-</nowiki>.+rename typed into File page text is published as written.{{#batchupload:Pics|+autoupload}}
Files added to this upload area start uploading straight away, without Upload being pressed.
Available configuration options:
$wgSimpleBatchUploadMaxFilesPerBatch - Array defining the maximum number of
files that can be uploaded each time depending on the user group. Default:$wgSimpleBatchUploadMaxFilesPerBatch = [
'*' => 1000,
];
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.
GNU General Public License 2.0 or later