html
javascript
var dat = new FormData()
dat.append(‘prefix‘, $(‘:input[name=prefix]‘).val())
dat.append(‘file‘, $(‘:input[name=upfile]‘)[0].files[0])
var req = $.ajax({
url: $(‘#upload‘).attr(‘action‘), data: dat, dataType: ‘json‘, type: ‘POST‘, contentType: false, processData: false
})
req.done(function(msg) {
alert(msg)
})
时间: 2024-10-09 05:42:33