How do you pre-populate a FilePicker?
Background: I have a form that does some additional validation after a user submits their data. The extra validation is needed because the user must be warned thet their inputs fall outside of typical values, but they should be allowed to continue if they desire or allowed to return to the form and modify their inputs. To acheive this, the form and its extra validation live in a while loop that allows them to keep entering/modifying inputs that trigger this extra-form-al validation until they either enter data that conforms to the validation or accept that their inputs are weird and continue anyway. When the form is reloaded, I pre-populate all of their previous values enetered so that they don't need to re-enter everything. A part of this form is the ability to upload an attachment.
So, how do I hold on to an uploaded fileItem and place it neatly in the form when they re-load it like all of the other inputs? I see documentation for a filepickerformitem.Files property but it seems to be at least inaccessible at runtime. Do I have any options here?
-
The contents of the native HTML file input cannot be set in code, as it would allow a site to pre-fill it with for instance c:\windows\passwords (or some other sensitive file). A casual user might inadvertently upload a file in this way.
What you could do is use Runtime Modifications to add the filename to a Group Description, or use a Markdown, e.g. ‘File(s) already selected: SomeFile.txt’.0 -
Thanks Berend, I actually had things set up just like this for a bit there. I was completing the upload/deletion process and then providing a list to the user when the form reloads. We figured that this was a bit confusing, since the rest of the form doesn't work that way, so we split the forms in two anyway. I figured that this "limitation" was actually a security feature, but was hopeful to discover otherwise! 0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare