diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts index fd94c70e2b..20ea80675b 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts @@ -69,7 +69,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit { case FormFieldTypes.UPLOAD: let files = this.field.value || []; if (files.length > 0) { - this.value = files[0].name; + this.value = decodeURI(files[0].name); } break; case FormFieldTypes.TYPEAHEAD: diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts index 2edf60dd6c..0e6e66e98c 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts @@ -47,22 +47,14 @@ export class UploadWidget extends WidgetComponent implements OnInit { } getUploadedFileName(): string { - let result = this.fileName; - - if (this.field && - this.field.value && - this.field.value.length > 0) { - let file = this.field.value[0]; - result = file.name; - } - - return result; + return decodeURI(this.fileName); } reset() { this.field.value = null; this.field.json.value = null; this.hasFile = false; + this.fileName = null; } onFileChanged(event: any) { @@ -72,10 +64,10 @@ export class UploadWidget extends WidgetComponent implements OnInit { let file = files[0]; this.hasFile = true; - this.fileName = file.name; + this.fileName = encodeURI(file.name); let formData: FormData = new FormData(); - formData.append('file', file, file.name); + formData.append('file', file, this.fileName); let xhr: XMLHttpRequest = new XMLHttpRequest();