(for the latter, see e.g.
However I have been not successful in getting it working and so were
fellow users (see e.g.
Using my current approach, I always get a " One of the parameters
filekey, file, url, statuskey is required", despite the fact that the
file is defined.
I used jQuery, doing the following request:
formdata = new FormData();
formdata.append("filename", fileName); //name of the file as string
formdata.append("token", myEditToken); //edit token retrieved via var
myEditToken = mw.user.tokens.get( 'editToken' );
formdata.append("file", fileToUpload); //file read via File Api using
url: mw.util.wikiScript( 'api' ),
data: formdata, //formdata: see
above the $.ajax for its definition
//success and error functions here,
but deleted for the sake of brevity.
Could you possible help me by telling me why the upload is not