我正在使用 ng2-file-upload 来上传任何类型的图像和文件,常规示例工作正常,但我实际上想检索上传文件的 blob 而不是使用常规处理,因为我要去在服务器端做我自己的处理。谁能告诉我选择后如何上传文件的blob?
我想做的是这样的:
this.uploader.onAfterAddingFile = fileItem => {
fileItem.withCredentials = false;
this.file
.uploadAttachment(fileItem)
.pipe()
.subscribe(data => {
console.log(data);
});
};