diff --git a/tdrive/frontend/public/locales/en.json b/tdrive/frontend/public/locales/en.json index cf5f57f9..2fbdd9ea 100644 --- a/tdrive/frontend/public/locales/en.json +++ b/tdrive/frontend/public/locales/en.json @@ -166,6 +166,7 @@ "components.newversion.new_version_component.link": "Click here to reload", "components.newversion.new_version_modal.title": "New update available !", "components.add_mails_workspace.text_area_placeholder": "Enter emails of your users*", + "services.file_upload_service.toaster.upload_file_error": "Error uploading file: {{$1}}", "services.console_services.toaster.add_emails_error": "Error while adding email(s)", "services.console_services.toaster.add_email_error_message": "Error while adding {{$1}}", "services.console_services.toaster.success_verify_email": "A verification link has been sent to your email account", diff --git a/tdrive/frontend/src/app/features/files/services/file-upload-service.ts b/tdrive/frontend/src/app/features/files/services/file-upload-service.ts index ce6d1d1f..8415074f 100644 --- a/tdrive/frontend/src/app/features/files/services/file-upload-service.ts +++ b/tdrive/frontend/src/app/features/files/services/file-upload-service.ts @@ -12,6 +12,8 @@ import FileUploadAPIClient from '../api/file-upload-api-client'; import { isPendingFileStatusPending } from '../utils/pending-files'; import { FileTreeObject } from "components/uploads/file-tree-utils"; import { DriveApiClient } from "features/drive/api-client/api-client"; +import { ToasterService } from 'app/features/global/services/toaster-service'; +import Languages from 'app/features/global/services/languages-service'; export enum Events { ON_CHANGE = 'notify', @@ -206,6 +208,9 @@ class FileUploadService { pendingFile.resumable.on('fileError', () => { pendingFile.status = 'error'; pendingFile.resumable.cancel(); + const intendedFilename = (pendingFile.originalFile || {}).name || (pendingFile.backendFile || { metadata: {}}).metadata.name; + ToasterService.error(Languages.t('services.file_upload_service.toaster.upload_file_error', [intendedFilename], + 'Error uploading file ' + intendedFilename)); options?.callback?.(null, options?.context || {}); this.notify(); });