-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Component: p-fileUpload mode=advanced auto=true not uploading on select #15212
Comments
I changed the source code of the fileupload.ts file and it works. --- a/src/app/components/fileupload/fileupload.ts
+++ b/src/app/components/fileupload/fileupload.ts
@@ -572,7 +572,7 @@
this.checkFileLimit();
}
- if (this.hasFiles() && this.auto && (!(this.mode === 'advanced') || !this.isFileLimitExceeded())) {
+ if (this.hasFiles() && this.auto && (this.mode !== 'advanced' || !this.isFileLimitExceeded())) {
this.upload();
}
Edit 23/04/2024: |
Hello, I am faceing the same problem with "primeng": "17.10.0" and updated it to "primeng": "17.13.0", but is not fixed the problem. Auto-update is only working with mode:"basic" I used your code https://stackblitz.com/edit/uc6ex8 as a guide but it did not worked for me.
"@angular/core": "^17.2.0", Thanks in advance. |
bump |
I didnt fix it to primeng repository, so the issue in PrimeNG still exists. My code is just a proposed fix. If you need to fix it in your project, you must copy the source code of the fileupload component, fix it, and import the corrected version. I did the same at https://stackblitz.com/edit/uc6ex8. Then, in the app.module.ts file, I imported the FileUploadModule from the project itself." |
Fix #15212: fileupload auto upload
Describe the bug
When using p-fileUpload in advanced mode with auto=true, the upload is not triggered
The problem should be this line in fileupload.ts, where there is an explicit check on mode that should be "basic" to trigger the upload()
https://github.com/primefaces/primeng/blob/17.12.0/src/app/components/fileupload/fileupload.ts#L563C1-L564C1
Environment
Reproducer
No response
Angular version
17.3.x
PrimeNG version
17.12.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v20.12.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: