I come across a question about ng2-file-upload, If I use it to upload at least a file, it works well. But if I do not select any file, it will crash and reload, and I can't get any error. Anyone know how to use ng2-file-upload to post a request without the file? This is my code:
<div>
<span>Upload:</span>
<input type="file" ng2FileSelect [uploader]="uploader" (change)="selectedFileOnChanged($event)"/>
</div>
uploader:FileUploader = new FileUploader({
url: "http://www.download.com:80/uploadFile",
method: "POST",
itemAlias: "uploadedfile"
});
this.uploader.uploadAll();