title: Upload file using angular material 5
body: <p>I tried to upload file (angular 5) using angular material 5. </p>
  
  <p>app.component.html</p>
  
  <pre><code>    &lt;mat-horizontal-stepper [linear]="isLinear" #stepper="matHorizontalStepper"&gt;
  
    &lt;mat-step [stepControl]="firstFormGroup"&gt;
      &lt;form [formGroup]="firstFormGroup"&gt;
        &lt;ng-template matStepLabel&gt;Upload your audio file&lt;/ng-template&gt;
        &lt;mat-form-field&gt;
            &lt;input matInput  
            style="display: none" 
            type="file" (change)="onFileSelected($event)" 
            #fileInput name ="file" formControlName="firstCtrl" required&gt;
        &lt;button mat-button (click)="fileInput.click()" &gt;Select File&lt;/button&gt;
    &lt;/mat-form-field&gt;
    &lt;div&gt;
      &lt;button mat-button matStepperNext&gt;Next&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>
  app.component.ts</p>
  
  <pre><code>export class AppComponent {
    selectedFile: File=null;
    isLinear = true;
    firstFormGroup: FormGroup;
    secondFormGroup: FormGroup;
    constructor(private _formBuilder: FormBuilder, private http: HttpClient) {}
    ngOnInit() {
     this.firstFormGroup = this._formBuilder.group({
       firstCtrl: ['', Validators.required]
      });
     this.secondFormGroup = this._formBuilder.group({
        secondCtrl: ['', Validators.required]
      });
    }
  </code></pre>
  
  <p>But I got this error</p>
  
  <pre><code>ERROR Error: Input type "file" isn't supported by matInput.
  </code></pre>
  
  <p>knowing this code worked well without angular material. Any issue?</p>