|
本帖最后由 L123666 于 2024-11-13 16:10 编辑
我按照样例写接口,给流转中的流程上传文件,但返回“FormData is not defined”的错误,应该怎么处理
AttachmentAction.upload接口
样例如下:
var formData = new FormData(); formData.append("extraParam", "参数值0"); formData.append("file", $("input[type=file]").files[0]); formData.append("fileName", "参数值2"); formData.append("site", "参数值3");var action = this.Actions.load("x_processplatform_assemble_surface"); action.AttachmentAction.upload(//平台封装好的方法 workId,//uri的参数 formData,//from参数 $("input[type=file]").files[0],//file参数function( json ){ //服务调用成功的回调函数, json为服务传回的数据 data = json.data; //为变量data赋值}.bind(this),function( json ){ //服务调用失败的回调函数, json为服务传回的数据 data = json.data; //为变量data赋值}.bind(this));
从报错来看,好像第一行定义的时候就出问题了,这个FormData要怎么弄?
|
|