Commit 331f47ec by kuayue

图片上传删除

1 parent 57f0d9c4
Showing with 19 additions and 1 deletions
......@@ -120,5 +120,22 @@ function backReturn(){
* 保存图片
*/
function saveReturn(){
alert("保存成功");
var file = document.getElementById("file").files[0];
console.log("file数据"+file);
var formData = new FormData();
formData.append('file', file);
$.ajax({
url: "/home/about",
type: "post",
data: formData,
contentType: false,
processData: false,
mimeType: "multipart/form-data",
success: function (data) {
console.log("返回正确数据"+data);
},
error: function (data) {
console.log("错误返回数据"+data);
}
});
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!