You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
I would like to use FineUploader’s onSubmit callback to change the endpoint based on what button was used. onSubmit passes in a file ID, but I can’t use the uploader to associate it with a button because <FileInput /> doesn’t assign a button ID to the file when it’s added.
Would it be possible to assign a unique button ID to each <FileInput /> instance?
The text was updated successfully, but these errors were encountered:
I think there will need to be something exposed in the API to allow an input device (such as a button) with the submitted files. One way to do this is by adding another optional param to the addFiles API method and then yet another method to retrieve the ID given a blob ID. And then of course React Fine Uploader will need to be updated to pass this value, if it exists, to addFiles. Probably just easier in your case to use a unique Uploader instance per button.
Another option: create your own wrapper for a file input element (should be pretty easy) and track the selected files. Test each submitted file against your tracked files to find the relevant button. Or PR to modify the FileInput component to allow these selected files to be exposed for this purpose.
Still another idea is for FileInput to append a property to each selected File object matching some ID passed to FileInput as a param. Then, in onSubmit, call getFile and check this prop. That is probably the simplest solution.
I think the FileInput should replicate what happens within the _onInputChange method. Prior to adding files, it annotates the file with the current button ID. (The button ID is generated here.)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I would like to use FineUploader’s
onSubmit
callback to change the endpoint based on what button was used.onSubmit
passes in a file ID, but I can’t use the uploader to associate it with a button because<FileInput />
doesn’t assign a button ID to the file when it’s added.Would it be possible to assign a unique button ID to each
<FileInput />
instance?The text was updated successfully, but these errors were encountered: