-
Notifications
You must be signed in to change notification settings - Fork 32
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
Extend <Field.Upload /> with onFileDownload
handler
#4355
Comments
onFileDownload
handler
Thanks for the detailed feature request, @torryt 🚀 I like the idea of a I'll have to look more into how this works as of today. I just took a quick search in the codebase, and as of today the code in Eufemia use multiple "file" properties, like |
I think this feature request is solved with the following PRs which is included in v10.60.0 of Eufemia:
Please report back, and reopen the feature request if you find anything missing @torryt 🙇 |
This works just as expected @langz . Thank you very much! 💯 🙏 |
🚀 Feature Proposal
Extend the <Field.Upload /> with a
onFileDownload
handler so that the full file can be downloaded on demand instead of pre-loaded in the form data.Motivation
The <Field.Upload /> component expects input as an array containing the full File object. This means that when we preload a large form with several steps, and possibly several
<Field.Upload />
components, we also have to load all the files already uploaded in the form and preload them into the form state, which can significantly delay the first page load.Example
onFileDownload
expects an async function that returns a file blob. When the function is provided, it overrides the default behavior of the file link and downloads from server instead of downloading the File object in the form state.Pitch
Reduces initial load time of forms with large files or many files and reduce unnecessary loading of documents that will probably not be downloaded.
The text was updated successfully, but these errors were encountered: