简体   繁体   中英

How do I remove the "Upload" and "Cancel" buttons from the PrimeNG p-fileupload component?

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?

According to documentation you should add below properties:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM