順便記錄一下如何使用jquery $ajax進行multiple-part的上傳方式
var formdata = new FormData();
//指定欄位的name與binary string
formdata.append("fileToUpload", file);
$.ajax({
data: formdata,
type: "POST",
url: "your_api/upload_imgur/" + uid,
// cache: false,
contentType: false,
// dataType: "json",//用這個叫api會404
processData: false,
success: function(rJSON) {
$.console("send file callback:");
}
});
參考https://github.com/HackerWins/summernote/issues/72
沒有留言:
張貼留言
留個話吧:)