Closed plima2050 closed 7 years ago
Set the URL: let URL = 'My API End Point'; public uploader:FileUploader = new FileUploader({ url: URL, headers: [{ ... }], });
this.uploader = new FileUploader({ url: apiUrl + '/Student/UploadImage', authTokenHeader: user.access_token, authToken: user.access_token, headers: [ { name: 'Authorization', value: 'bearer '+user.access_token } ], queueLimit: 1 });
Thanks. @hetzbr, @aviforgit. Shared it work fine me. this.uploaderOptions['url'] = URL; this.uploaderOptions['method'] = 'POST'; this.uploaderOptions['autoUpload'] = false; this.uploader.setOptions(this.uploaderOptions);
uploader: FileUploader;
options: FileUploaderOptions = {
url: '/api/file',
authToken: 'Bearer ' + Utils.getToken(),
authTokenHeader: 'Authorization',
};
ngOnInit() {
this.uploader = new FileUploader(this.options);
}
I need to send file to web api services restfull. please help me