this.http.post(url, body, header)
<ejs-uploader #defaultupload (uploading)="onuploading($event)" (removing)="onremove($event)" [asyncSettings]='path'></ejs-uploader>
// To add the header in save Url
public onuploading(args: any) {
args.currentRequest.setRequestHeader('Authorization', ‘username’);
}
// To add header in remove Url
public onremove(args:any) {
args.currentRequest.setRequestHeader('Authorization', ‘username’);
}
|
[web.config]
<customHeaders>
<add name="Access-Control-Allow-Headers" value="accept, maxdataserviceversion, origin, x-requested-with, dataserviceversion,content-type, Authorization" />
…
</customHeaders> |
<ejs-uploader #chunkUpload [maxFileSize]=104857600 [autoUpload]=false (chunkUploading)="onChunkUploading($event)" (removing)="onRemove($event)" [asyncSettings]='path'></ejs-uploader>
// To add the header in save Url on every chunk upload
public onChunkUploading (args: any) {
args.currentRequest.setRequestHeader('Authorization', ‘username’);
}
// To add header in remove Url
public onRemove(args:any) {
args.currentRequest.setRequestHeader('Authorization', ‘username’);
}
|
public onFileUpload = (args: any) => {
// add addition data as key-value pair.
args.customFormData = [{ name: "Syncfusion INC" }];
}
|
// Get the additional data in server end by corresponding key.
var data = HttpContext.Current.Request.Form["name"];
|