0
我是angular2中的新成員。我正在使用ng2-uploader上傳文件。 我html的我用下面的代碼:angular2使用ng2-uploader上傳文件
<input type="file" ngFileSelect [options]="options" (onUpload)="handleUpload($event)" (beforeUpload)="beforeUpload($event)">
在組件:
uploadFile: any;
hasBaseDropZoneOver: boolean = false;
options: Object = {
url: 'http://localhost:3000/upload'
};
在module.ts:
import { Ng2UploaderModule } from 'ng2-uploader';
我遵循相同的鏈接和使用函數「handleUpload」和「fileOverBase」和「beforeUpload」。它顯示正確的錯誤,我上傳超過文件大小,但我的文件大小是好的比它顯示我的錯誤:「錯誤TypeError:this.files.filter不是在NgFileSelectDirective.onChange(ng-file-select.ts:70 )「.... @ Ozesh – rohit13807