Tech Tangents:Sandbox: Difference between revisions

From Tech Tangents
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:
         const api = new mw.Api();
         const api = new mw.Api();
         let param = {
         let param = {
           filename: "File_2.jpg",
           filename: fileInput.name,
           format: "json",
           format: "json",
           ignorewarnings: 1,
           ignorewarnings: 1,
Line 17: Line 17:


         api
         api
           .upload(fileInput.files[0], param)
           .upload(fileInput, param)
           .done(function (data) {
           .done(function (data) {
             console.log(data.upload.filename + " has sucessfully uploaded.");
             console.log(data.upload.filename + " has sucessfully uploaded.");

Revision as of 21:04, 6 September 2024