var inputObj = document.createElement(“input”);
inputObj.type = “file”;
inputObj.click();
inputObj.onchange = function () {
var file = inputObj.files[0];
console.log(file, “文件流”);
var formdata = new FormData();
formdata.append(“file”, file);
request({
url:
that.
d
e
f
i
n
e
.
P
R
O
J
E
C
T
[
t
h
a
t
.
define.PROJECT[that.
define.PROJECT[that.define.DEFAULT_PROJECT]
.VUE_APP_API_BASE_URL + that.atturl,
method: “post”,
data: formdata,
})
.then((res) => {
上传一个input文件
最新推荐文章于 2024-07-12 15:49:20 发布