-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: Ability to add file from variable #3044
Comments
Audiopolis
added
the
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
label
Jul 7, 2022
I think it's the same issue as #2893 which I just submitted a PR for. |
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
labels
Jul 7, 2022
Yep, thank you and sorry about the duplicate. |
No worries! More people reporting it just means it's more urgent to fix! |
melloware
changed the title
Ability to add file from variable
FileUpload: Ability to add file from variable
Jul 11, 2022
melloware
added
Resolution: Duplicate
Issue has already been reported or a pull request related to same issue has already been submitted
and removed
Type: Bug
Issue contains a defect related to a specific component.
labels
Jul 11, 2022
mertsincan
removed
the
Resolution: Duplicate
Issue has already been reported or a pull request related to same issue has already been submitted
label
Jul 18, 2022
This is still happening on 8.3.0 const fileUploadRef = useRef<FileUpload & { onFileSelect(event): void }>(null)
const onCameraFinish = (file: File) => {
setShowCamera(false)
const event = {
target: {
files: [file],
},
}
fileUploadRef.current?.onFileSelect(event) # onFileSelect is not a function
} |
melloware
added
the
Type: Bug
Issue contains a defect related to a specific component.
label
Aug 3, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Aug 3, 2022
My bad! Please review my PR: #3132 |
melloware
added a commit
to melloware/primereact
that referenced
this issue
Aug 7, 2022
melloware
added a commit
to melloware/primereact
that referenced
this issue
Aug 7, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the feature you would like to see added
Before today, we were on 7.2.1. We have two options for selecting a file: upload a local file or take a photo with your camera. When using the camera option (using react-webcam), we did the following in order to add it to the File
After upgrading to 8.2.0,
fileUploadRef.current?.onFileSelect
is no longer defined.We would like a way to add files to the component without going through the normal file selection process.
Is your feature request related to a problem?
We are unable to upload files gotten by other means than the normal file selection process.
Describe the solution you'd like
Some way of adding files to FileUpload's list of files programmatically.
Describe alternatives you have considered
I have looked at the defined properties of the ref and found no suitable members. I have considered using a different component for photo uploads, but this would be a major and unacceptable downgrade. I have considered downgrading, but this is not possible as we are at the end of a very much needed upgrade process. We need React 18 support.
Additional context
There may be a way of doing this that I'm not aware of, but it's not clear from docs or anything I've found on Google.
The text was updated successfully, but these errors were encountered: