Home > OS >  How do I remove the "Upload" and "Cancel" buttons from the PrimeNG p-fileupload
How do I remove the "Upload" and "Cancel" buttons from the PrimeNG p-fileupload

Time:08-19

I'm using Angular 13 with PrimeNG 13. I want to allow a file upload in my form so I have created

  <p-fileUpload [maxFileSize]="1000000" [customUpload]="true" [multiple]="false" formControlName="myFile"></p-fileUpload>
                    

This creates a single file dialog with "Choose", "Upload" and "Cancel" buttons. It seems that after choosing a file, I must then click "Upload" to get the file into my form.

Is there a way to create the component so that it only allows for upload of a single file and that initially choosing the file adds it into my form?

CodePudding user response:

According to documentation you should add below properties:

mode="basic" 
[auto]="true"
  • Related