上传文件-jq

2023-03-12,

var formFile = new FormData();
formFile.append("[file]", fileObj);
formFile.append("type", uploadKey.type);
formFile.append("contentType", uploadKey.contentType);
formFile.append("contentParser", uploadKey.contentParser);
formFile.append("ignore1stLine", uploadKey.ignore1stLine);
formFile.append("charset", uploadKey.charset);
formFile.append("key", uploadKey.key);

$.ajax({
type:'POST',
url: 'http://59.108.70.66:8080/api/project/'+$nps$.portal.projectInfo.data._id+'/collection/'+oid+'/push',
processData: false,
contentType: false,
enctype:'multipart/form-data',
data:formFile
}).done(function(results){
$nps$.showMsg({
title: $nps$.portal.lang.tipText,
msg: '上传成功,请返回!',
width: 300,
bbar: {confirm: true},
confirmclick: function()
{
win.hide();
},
scope: this
});
})

上传文件-jq的相关教程结束。

《上传文件-jq.doc》

下载本文的Word格式文档,以方便收藏与打印。