Hi - how do I change the source filename to a different name before uploading the file? Let me know. Thanks.
<ejs-uploader #defaultupload id='defaultfileupload' [asyncSettings]='path' [dropArea]='dropElement' (selected)='onFileSelect($event)' ></ejs-uploader>
|
public onFileSelect: EmitType<Object> = (args: any) => {
args.filesData[0].name = 'modified-'+args.filesData[0].name;
}
|
Hi Deepak - thanks for the reply. Is it possible for the user to change it using the interface than changing it in the code-behind? For example, the user does a browse and selects a file called filename-001.jpg but the user wants the file to be called sarasota-vacation-1.jpg. Will it be possible to have a provision for the user to edit and change the filename before uploading it? Let me know. Thanks.
public onFileSelect: EmitType<Object>
= (args: any) => {
this.uploadObj.showFileList = false;
this.promptDialog.show();
this.originalFileName = args.filesData[0].name;
this.filename.value = args.filesData[0].name;
this.eventArgs = args.filesData;
}
public promptDlgBtnClick = (): void => {
this.eventArgs[0].name = this.filename.value;
this.uploadObj.createFileList(this.eventArgs);
this.uploadObj.showFileList = true;
this.promptDialog.hide();
this.uploadObj.upload(this.uploadObj.getFilesData());
}
public promptCancelClick = (): void => {
this.promptDialog.hide();
}
|
Hi Deepak - thanks a lot for the sample code. Would it be possible to send me a sample for updating multiple filenames during a bulk upload? Thanks.