Topic: Upload files
Gay pro asked 5 years ago
Expected behavior When i select file when i click Upload it should upload my file to my server.
Actual behavior When i click upload button the 'this.uploadInput.emit(event)' function is trigger but absolutely nothing happen.
Resources (screenshots, code snippets etc.)
startUpload(): void {
console.log(this.files);
console.log("should upload");
const event: UploadInput = {
type: 'uploadAll',
url: ${environment.notifyEndPoint}api/upload
,
method: 'POST',
data: { foo: 'bar' },
};
this.files = [];
this.uploadInput.emit(event) ;
}
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 6.2.1
- Device: all
- Browser: all
- OS: all
- Provided sample code: Yes
- Provided link: No
Gay pro commented 5 years ago
I cant even get the regular file from your 'UploadFile' object to send it to my server by my own method.
Damian Gemza staff commented 5 years ago
Dear @Gay
Please provide me with the full code of this example - HTML and TS. Are you sure, that server endpoint is created properly?
Please take a look at the tutorial which we have created for the File Input: https://mdbootstrap.com/docs/angular/forms/file-input/
Best Regards,
Damian