Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileUpload: Upload broken for mode='advanced' and customUpload=true #15117

Closed
mathiasengelhardt opened this issue Mar 20, 2024 · 4 comments
Closed

Comments

@mathiasengelhardt
Copy link

Describe the bug

When using FileUpload like this:
<p-fileUpload (uploadHandler)="handleFileUpload($event)" [auto]="true" [customUpload]="true"></p-fileUpload>, the uploadHandler callback won't be called.
See fileupload.ts, line 563:

        if (this.hasFiles() && this.auto && !(this.mode === 'advanced') && !this.isFileLimitExceeded()) {
            this.upload();
        }

Prior to version 17.8.0, the (working) code was:

        if (this.hasFiles() && this.auto && (!(this.mode === 'advanced') || !this.isFileLimitExceeded())) {
            this.upload();
        }

Environment

Windows

Reproducer

No response

Angular version

17.3.0

PrimeNG version

17.11.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@mathiasengelhardt mathiasengelhardt added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 20, 2024
@rafparedis
Copy link

rafparedis commented Mar 21, 2024

I also have this same problem. FileUpload component stopped working

<p-fileUpload name="uploadedFiles[]" customUpload="true" auto="true" (uploadHandler)="onUpload(section.section,$event)"

also using customUpload

Angular version

17.3.1
PrimeNG version
17.11.0
17.12.0

@astranCZ
Copy link

astranCZ commented Mar 22, 2024

Even advanced mode with the auto attribute does not work.
Last function version primeng is 17.7.0.

https://stackblitz.com/edit/gunrgk?file=src%2Fapp%2Fdemo%2Ffile-upload-advanced-demo.html

@Sara-pixie
Copy link

Sara-pixie commented Mar 22, 2024

seems like the issue can be solved by using mode=basic, but if you actually need the advanced mode like us there's no way around it.

I believe the breaking change was made in v 17.8.0

@cetincakiroglu
Copy link
Contributor

cetincakiroglu commented Mar 29, 2024

Hi,

This issue is duplicate of #15150
The related issue is fixed and added to the 17.13.0 milestone.
Closing this one.

Thanks a lot for reporting the issue

@cetincakiroglu cetincakiroglu removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants