How to Delete Files Uploaded on Wiki

This commodity describes how MediaWiki handles and stores files, and gives some information on configuring.

This applies to images every bit well equally to any other blazon of file that can be uploaded. All files are stored with a corresponding article in the "File:" namespace. Prior to MediaWiki 1.14, the "Paradigm:" namespace was used instead. "Epitome:" is still retained equally an alias for astern compatibility.

Upload and usage of images [edit]

Meet Help:Images

Enable upload of images [edit]

To upload files, these conditions take to be met:

  1. MediaWiki must have uploads enabled. Set up $wgEnableUploads to truthful.
  2. The file blazon must exist allowed. More information: $wgFileExtensions .
  3. The user must be in a group with the "upload" right. By default this is given to all logged-in users.

Uploads are done using Special:Upload.

See Transmission:Configuring file uploads , Manual:Mime type detection and Manual:Adding support for new filetypes

Relevant parameters for file treatment [edit]

These parameters are relevant:

  • Epitome configuration
  • Path configuration
  • Upload configuration

Image thumbnailing [edit]

MediaWiki's extended epitome syntax allows images to be automatically thumbnailed (see Transmission:Configuring file uploads for general help on file uploads).

Prototype thumbnailing requires either ImageMagick or GD library – neither are role of the default MediaWiki installation, although some versions of PHP include GD. ImageMagick is recommended if ameliorate quality thumbnails are needed; it can exist downloaded from imagemagick.org. GD is included in some versions of PHP, and information technology is recommended to use GD on Windows systems. A standalone download of GD is available from LibGD GitHub. In newer versions this is not required.

If you lot utilise ImageMagick, set up $wgUseImageMagick to truthful in LocalSettings.php. Make sure the $wgImageMagickConvertCommand variable points to the (absolute) location of the convert command of your installation and that the command is executable by the web server procedure. For instance, Windows users will want to alter the default to "C:\ImageMagick\convert.exe" (or similar).

To re-create erstwhile thumbnail files earlier you lot used ImageMagick you can use $wgThumbnailEpoch .

If rendering fails silently, bank check and increase $wgMaxShellMemory .

GraphicsMagick tin also be used as an culling to ImageMagick. Yous will need to set $wgCustomConvertCommand to the following. E.g.:

                        $wgUseImageMagick            =            false            ;            $wgCustomConvertCommand            =            "gm catechumen %s -resize %wx%h %d"            ;          

GIF [edit]

For thumbnailing GIF-Animations under windows, you need to install ImageMagick every bit described in a higher place.

SVG [edit]

Wikimania 2016 presentation on Dynamic SVG

MediaWiki supports SVG image rendering: if enabled, SVG images can be used like other image files — they volition automatically be rendered every bit a PNG file and thumbnailed as needed on the fly. If you're on a shared host and no SVG renderer is pre-installed, you should probably ask your provider to install information technology for you.

To enable SVG support:

  1. Permit upload of SVG files in the LocalSettings.php file: $wgFileExtensions [] = 'svg'; Annotation that MediaWiki volition refuse SVG files containing JavaScript, for security reasons.
    To avoid a false positive, add together $wgAllowTitlesInSVG = true; to the LocalSettings.php file.
    If you are using MediaWiki i.34 or higher, $wgAllowTitlesInSVG is never applied and now always true. Yous can safely remove this in your LocalSettings.php file.
    If you get an error saying the file is corrupt, make sure mime blazon detection is working properly.
  2. Add together $wgSVGConverter to LocalSettings.php and set the renderer you lot desire to utilise.
    Available options are ImageMagick, ImagickExt, sodipodi, inkscape, batik, rsvg, and imgserv.
    For example: $wgSVGConverter = 'ImageMagick' ;
    • If the converter program is not in the organization path, y'all have to specify the directory that contains the plan using $wgSVGConverterPath ..

    • librsvg is fast but not very accurate. It depends on a big number of libraries. To automatically install all these libraries, you may want to use a package manager. The Wikimedia projects use rsvg.
    • Batik is the most authentic SVG renderer available, although its anti-aliasing is sometimes suboptimal. Its SVG parsing is more strict, causing it to reject "well-nigh valid" SVG files that other renderers accept (e.m. eatables:File:UbuntuCoF.svg). Batik relies on Coffee, and is much slower than rsvg, though this may not exist a huge event unless you lot're constantly adding SVG files. See SVG benchmarks. Requires a lot of work to get running, if not included in your distribution.
    • Inkscape besides does an accurate job of SVGs, half the speed of rsvg, but was designed for interactive graphical use; however, it comes with inkview which is a viewer/converter program – it requires a writable home directory for the user it's run every bit. Since it will be running as user www or something similar, it will endeavour to create .inkscape/ and .gnome2/ directories in the corresponding home directory, and will fail silently, crash or hang indefinitely if it is not able to. Inkscape is preferable to rsvg (a) on Windows (it comes every bit a standalone package) or (b) if you have important SVGs drawn in Inkscape that practice not return correctly in rsvg. Inkscape has every bit complicated a dependency concatenation every bit librsvg — use only if information technology'south in your distribution or available as a complete standalone package.
    • Sodipodi is the program Inkscape was forked from. The same considerations apply. Sodipod is no longer under active development.
    • Since version 6.x.x ImageMagick renders SVGs, but imperfectly. This is the default, but avoid it if possible. However, it does piece of work. On Windows, $wgConvertPath must exist set to avoid a conflict with Windows' own convert.exe. I uncomplicated alternative in this scenario is to add to LocalSettings.php the line $wgSVGConverters [ 'ImageMagick' ] = '"' . $wgImageMagickConvertCommand . '" -groundwork white -thumbnail $widthx$height^! $input PNG:$output' ; , which also allows for spaces in the path.
      • To forestall thumbnail creation errors with ImageMagick, if it's ≥ 7.0.nine-25, and then Inkscape must also be ≥ 1.x.x. Also, if ImageMagick is < seven.0.ix-25, and so Inkscape must besides exist < 1.x.x. Encounter ImageMagick outcome.
    • The PHP Imagick extension supports SVG rendering, notwithstanding the same considerations as for the regular ImageMagick apply.
    • The GD library is not capable of converting SVG images to the PNG format, at least according to Joen Asmussen's June 2008 NoScope blog.
    • Most electric current web browsers except Net Explorer (until version ix) can display SVGs directly. Using librsvg to render SVGs to a PNG will give much more authentic results, besides every bit less bandwidth consumption. Straight SVG display is not supported in MediaWiki by default (chore T5593), unless you lot install NativeSvgHandler extension.

Set up $wgSVGConverter = fake if SVG rendering is not needed and yous wish to make your users download the svg file in lodge to view it.

Troubleshooting [edit]

If you run into a blank square instead of SVG (Chrome) or no image at all (Firefox) and all PNG links lead to 404 error and yous don't see any other error message anywhere please cheque $wgGenerateThumbnailOnParse variable. Setting information technology to false may make SVG transformation deferred ever. Make sure that proc_open and symlink PHP methods are enabled (they may be disabled in php.ini for security or performance reasons).

JPEG (using GD) [edit]

Simply add the post-obit line to LocalSettings.php, this will crusade auto autumn back to GD library.

                        $wgUseImageMagick            =            false            ;          

For errors with JPEG thumbnails, see JPEG (using GD).

TIFF [edit]

Generating thumbnails of TIFF files requires MediaWiki 1.15.0 or newer.

  1. Allow upload of TIFF files in the LocalSettings.php file: $wgFileExtensions [] = 'tif';
  2. Add $wgTiffThumbnailType to LocalSettings.php and prepare to either jpg or png to specify which blazon of thumbnail you lot wish to accept generated.
  3. Making thumbnails of TIFF files may crave system resource across those needed for thumbnailing JPEG, GIF, or PNG files. Consider appropriate settings for $wgMaxImageArea and $wgMaxShellMemory

DjVu [edit]

Deletion of images [edit]

Files, like wiki pages, tin can merely exist deleted by users with the "Delete pages (delete)" permission (administrators past default). Deletion of files is done by deleting the associated description page (or by clicking the "delete all" link in the "File history" tabular array).

Deletion of individual revisions [edit]

If a file has been altered, there is a revision history of the files which is displayed on the file article page. Each revision has a "delete" link. If this is clicked, the revision and the file are deleted.

The versions of files are separate from the page history of the file clarification page.

Information about erstwhile revisions of files are stored in the oldimage tabular array while data on old revisions of the pages are stored in the revision table.

Undeleting files [edit]

Files can be undeleted in exactly the same way equally normal wiki pages. The directory in which deleted files are stored is divers by Manual:$wgDeletedDirectory . Information almost deleted images are stored in the filearchive table.

Deletion of Archived Files [edit]

Since MediaWiki version 1.11, deleted images are nonetheless stored on the server by default. If you want to delete selected archived images, y'all tin practice then using the eraseArchivedFile.php maintenance script. If you want to delete all of them completely, you can exercise that with the deleteArchivedFiles.php script. If you delete archived files, you can non undelete those files anymore.

Reasons for Deleting a File [edit]

When choosing to delete a file, as described above, users will exist asked to provide a reason for deletion. The available reasons tin can be edited on the MediaWiki:Filedelete-reason-dropdown of your wiki.

Information storage [edit]

Whenever an image is uploaded, several things are created:

  1. An article in the file namespace with the name of the file, eastward.k. File:MyPicture.png. This page is stored and can be edited like any other page.
  2. The file itself is stored in a binder on the file system with whitespaces merged and replaced with _.
  3. If necessary and thumbnailing is available, thumbnailed versions of the file will be created when necessary (such equally for the usage on the file description folio). These are stored in the thumb directory of the prototype directory, in a separate directory for each master file.

If $wgHashedUploadDirectory is enabled (by default), MediaWiki creates several subdirectories in the images directory.

The directory names are from the offset two characters of the md5 hash of the final filename.

Folders [edit]

All paradigm files are stored in a folder adamant by $wgUploadPath (images/, past default).

Description of named paradigm subfolders:

archive
This is the storage identify for files that accept been replaced by newer versions.
temp
used for temporary storage of files during paradigm uploading. (Due to task T11018, these files may non always be automatically deleted)
thumb
Thumbnails (automatically generated) for the files. If these are deleted, they are automatically regenerated when needed.

Depending on the configuration, there may exist additional image subfolders:

math
Binder to store your rendered TeX input, see also Extension:Math or Transmission:Math.
x/xy
If $wgHashedUploadDirectory is gear up to true (which is the default), images will be stored in subfolders of the images, thus making file paths await like images/a/ab/filename.jpg. See Manual:$wgHashedUploadDirectory for more details on why this might be desired and how this system works.

Database tables [edit]

  • The file description page is stored as whatsoever page in the page, text, revision etc. tables
  • image - Holds some metadata such equally the size of the file and the upload appointment.
  • oldimage - This stores data for files that have been replaced with newer versions.
  • filearchive - holds the information on the deleted files.
  • imagelinks - Records what pages use a file.

Space usage [edit]

Files need considerably more infinite than articles. The following calculations assume a block size of 4KB with Linux/Unix servers.

The default setting is $wgHashedUploadDirectory = truthful .

Infinite requirements for all directories:

  • image directories: 0-f/x0-f: max. 16*16 = 256 directories = 256*4 KB = 1024 KB
  • annal directories: 0-f/x0-f: max. xvi*16 = 256 directories = 256*four KB = 1024 KB
  • pollex directories: 0-f/x0-f: max. 16*16 = 256 directories = 256*four KB = 1024 KB
  • temp directories: 0-f/x0-f: max. sixteen*sixteen = 256 directories = 256*4 KB = 1024 KB

Therefore, the bones corporeality of space needed without any images uploaded is 4 MB in theory (although the directories are created only when needed).

For each file we demand:

  • size of the original image file + ii KB average overhead

For files that need to be thumbnailed:

  • size of the created thumbnail(s) + 2 KB average overhead (each)
  • directory for thumbnail (4KB) (each image has its ain thumbnail directory)

Examples:

  • image 20778 Byte png (small size, no thumb): 24 KB for the image: Total 24 KB
  • image 123.000 Byte jpeg (big size, auto thumb): 124 KB for the paradigm, 4 KB for the pollex directory, 64KB for the thumb: Total: 192 KB

File Access [edit]

Uploaded files are generally served directly by the web server, not through MediaWiki. While there may exist a minimal level of security through obscurity with path encryption (e.g. /c/c4/...) if $wgHashedUploadDirectory is set, the path can exist calculated hands from the file proper noun and does non provide truthful protection.

For limiting admission to authorized users, meet Manual:Image authorization .

Upload form [edit]

See the documentation on configuring the upload course.

Licensing [edit]

A feature of MediaWiki allows the Special:Upload Page to streamline licensing of images. Wikipedia's Upload Folio has a Licensing drop downwards box below image summary. This feature is turned off in default MediaWiki. To plow this feature on a sysop needs to edit Licenses in the MediaWiki namespace (example: MediaWiki:Licenses). They tin can do this by going to the MediaWiki:Licenses page of their wiki and clicking 'create' or 'edit'.

The page MediaWiki:Licenses expects a certain format in a wiki list.

*subst:license 1|license 2|License text
* Header 1:
** cc-past-sa-2.5|Attribution ShareAlike two.5

Line 1 will produce "License text" and substitute the license 1 template in the prototype page and transclude license 2.
Line 2 will bear witness a greyed out header with text "Header i:"
Line iii volition produce "Attribution ShareAlike 2.5" and transclude template cc-by-sa-2.5 on the paradigm page.

For detailed real world example, run across Wikipedia:MediaWiki:Licenses or Eatables:MediaWiki:Licenses.

Strange Repositories [edit]

It is possible to access files stored in foreign repositories, without needing to upload them to the wiki, by setting the $wgForeignFileRepos array. This feature offers several possibilities:

  • ForeignAPIRepo accesses files from a remote MediaWiki installation, such every bit Wikimedia Eatables, through its API
  • ForeignDBRepo accesses files through a database, and is useful for creating wiki families
  • FSRepo accesses files from a local binder

In all cases, i would exist able to embed files into a page using ordinary image syntax and specifying the name of the file in the foreign repository. Note that some of the above implementations are still experimental, and might not exist suitable for product sites.

horvathyets1936.blogspot.com

Source: https://www.mediawiki.org/wiki/Manual:Image_administration

0 Response to "How to Delete Files Uploaded on Wiki"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel