<input name="file" type="file" id="file" onchange="var f=this.files[0];var formData=new FormData();formData.append('smfile',f);jq.ajax({url:'https://sm.ms/api/upload',type:'POST',success: function(data){if(data.data){jq('#res .blockcode div ol li').html(JSON.stringify(data.data.url).slice(1,-1));jq('#res').show()}else{jq('#res .blockcode div ol li').html('error');jq('#res').show()}},error:function(data){jq('#res .blockcode div ol li').html('error');jq('#res').show()},data:formData,cache: false,contentType: false,processData:false});">