rajeshkumar
rajeshkumar

Reputation: 39

Edit the mediawiki uploaded file name

In Mediawiki, we are uploading video using mediawiki api. Its uploading fine.It will be creating as a page like "File:Test.mp4". Now we want to edit the page title alone (Like "File:Test.mp4" to "File:Sample.mp4, but the video will be same). Kindly suggest any solution for editing.

Upvotes: 1

Views: 1340

Answers (1)

leo
leo

Reputation: 8541

To rename a MediaWiki page, you move it. This can be done with the API, if you don't want to move it manually:

/api.php?action=move&from=File:Test.mp4&to=File:Sample.mp4&token=xxxx

When you move a file page, the corresponding file will also be renamed. A redirect will be created from the old file page, so that both [[File:Test.mp4]] and [[File:Sample.mp4]] works throughout the wiki.

Upvotes: 2

Related Questions