Upload a file, or get the status of pending uploads.
Several methods are available:
Upload file contents directly, using the file parameter.
Upload the file in pieces, using the filesize, chunk, and offset parameters.
Have the MediaWiki server fetch a file from a URL, using the url parameter.
Complete an earlier upload that failed due to warnings, using the filekey parameter.
MediaWiki, which Wikipedia is based on, can upload files by fetching them from a remote URL on command and also send emails!
From https://en.wikipedia.org/w/api.php?action=help&modules=upload:
From https://en.wikipedia.org/w/api.php?action=help&modules=emailuser:
How cool is that?!