作者在 2017-08-02 17:38:25 发布以下内容
挺简单的
var img_url = $input_verifycode.next('img').attr('src');
var r = new XMLHttpRequest();
r.open("GET", img_url);
r.responseType = "blob";
r.onload = function(e){
var data = new FormData();
data.append('image_data', this.response);
$.ajax({
url: 'http://localhost:8088/upload.php',
data: data,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function(data){
//alert('上传成功');
}
});
};
r.send();