select file upload form-data is empty #676

Open
opened 2017-03-15 20:28:59 +00:00 by ghost · 2 comments
ghost commented 2017-03-15 20:28:59 +00:00 (Migrated from github.com)

html:
<input type="file" ng2FileSelect [uploader]="uploader"/>

<button type="button" name="button" class="upload-file-btn" (click)="uploadFile()">upload/button>

ts:

uploadFile() {
console.log(this.uploader);
// console.log(this.uploader.queue[0].);
// 上传
this.uploader.queue[0].onSuccess = function(response, status, headers) {
// 上传文件成功
if (status == 200) {
console.log(response);
// 上传文件后获取服务器返回的数据
// let tempRes = JSON.parse(response);
} else {
// 上传文件后获取服务器返回的数据错误
alert("");
}
};
this.uploader.queue[0].upload(); // 开始上传
}

html: <input type="file" ng2FileSelect [uploader]="uploader"/> <button type="button" name="button" class="upload-file-btn" (click)="uploadFile()">upload/button> ts: uploadFile() { console.log(this.uploader); // console.log(this.uploader.queue[0].); // 上传 this.uploader.queue[0].onSuccess = function(response, status, headers) { // 上传文件成功 if (status == 200) { console.log(response); // 上传文件后获取服务器返回的数据 // let tempRes = JSON.parse(response); } else { // 上传文件后获取服务器返回的数据错误 alert(""); } }; this.uploader.queue[0].upload(); // 开始上传 }
brunachamon commented 2017-05-30 14:01:20 +00:00 (Migrated from github.com)

I have the same problem :( any ideas?

I have the same problem :( any ideas?
tapahbl4 commented 2017-05-31 15:14:49 +00:00 (Migrated from github.com)

Me too the smae problem. Any ideas?

Me too the smae problem. Any ideas?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#676