ajax實現文件上傳(使用FormData)

文件上傳通常是同過表單來上傳,但表單提交不知足全部狀況,部分狀況須要ajax上傳文件 <input type="file" id="file"> js獲取文件web var file=$('#file')[0].files[0]; 文件輸出以下: 咱們先嚐試經過$.post()方法來上傳文件ajax // $.post("massagesdsd",{file:file},function (dat
相關文章
相關標籤/搜索