<div *ngIf="!!object?.id && !!objectUploadForm" layoutDirection="column" class="fl-content fl-content-min-height">
  <p *ngIf="!object?.id" i18n>Uploading to: {{path ? path : '/'}}</p>
  <p *ngIf="object.id" i18n>Change file contents</p>
  <form appFormSubmit (ngSubmit)="objectController.actionCallback(primaryAction)"
        [formGroup]="objectUploadForm" layoutDirection="column">
    <!--suppress JSUnusedGlobalSymbols -->
    <app-form-errors #formErrors [formGroup]="objectUploadForm"></app-form-errors>
    <app-credit-warning *ngIf="!object?.id" resourceName="object" i18n-resourceName></app-credit-warning>
    <mat-form-field>
      <input type="file" class="fl-ellipsis-text" (change)="fileChanged($event)" required>
      <input matInput type="text" formControlName="file" required class="hide">
      <mat-error>{{fieldErrors['file']}}</mat-error>
    </mat-form-field>
    <mat-form-field>
      <mat-label i18n>File name</mat-label>
      <input matInput i18n-placeholder placeholder="File name" type="text" formControlName="name" required
             [maxLength]="maxObjectNameLength">
      <mat-error>{{fieldErrors['name']}}</mat-error>
    </mat-form-field>
    <p *ngIf="file" i18n>Content type: {{file.type || 'application/octet-stream'}}</p>
  </form>
  <mat-progress-bar *ngIf="uploading" class="upload-progress" color="primary" mode="determinate" value="{{uploadProgress}}">
  </mat-progress-bar>
</div>
