File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/app/features/file/edit-file Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export class EditFileComponent extends EditComponent<string> implements OnInit {
8686 }
8787
8888 protected saveNewFile ( file : File ) {
89- // The maximum file size which can be processed by CouchDB before a timeout is around 200mb
89+ // The maximum file size is set to 5 MB
9090 this . fileService
9191 . uploadFile ( file , this . entity , this . formControlName )
9292 . subscribe ( {
@@ -100,7 +100,13 @@ export class EditFileComponent extends EditComponent<string> implements OnInit {
100100
101101 private handleError ( err ) {
102102 Logging . error ( "Failed uploading file: " + JSON . stringify ( err ) ) ;
103- this . alertService . addDanger ( "Could not upload file, please try again." ) ;
103+
104+ let errorMessage = $localize `:File Upload Error Message:Failed uploading file. Please try again.` ;
105+ if ( err ?. status === 413 ) {
106+ errorMessage = $localize `:File Upload Error Message:File too large. Usually files up to 5 MB are supported.` ;
107+ }
108+ this . alertService . addDanger ( errorMessage ) ;
109+
104110 // Reset entity to how it was before
105111 this . entity [ this . formControlName ] = this . initialValue ;
106112 this . formControl . setValue ( this . initialValue ) ;
You can’t perform that action at this time.
0 commit comments