Converting 'value' of an UploadButton to a "true" File object?

Hello, I was wondering how to use the output of the UploadButton value which the Velo documentation calls (in multiple places) an ‘array of File objects’. After some basic testing (such as the fact that constructor name returns Object, not File), its elements do not seem to be File objects, at least in the regular JavaScript sense, as basic functionality such as the use of a FileReader and the fact that it inherits functionality from the Blob class is not present.

Without uploading the file to Wix, I would like to make use of the File object locally, which requires the use of functionality that the usual File object seems to have, but the Velo version does not. If possible, how can I convert Velo’s version to a true File object?

If helpful, the reason this is needed is that one of the APIs I am utilizing parses and uses Blob’s (which works fine when I test this functionality out using a classic HTML and JavaScript file), so I am usually able to pass in a File object here, but this doesn’t work with Velo’s version.

Thank you in advance for any help!

Any news on this? I have the same question here, but can’t find an answer anywhere!

Hello, I ended up using an HtmlComponent. I placed a transparent HTML button in my container and placed above a Wix button. When the user clicks the input button, I post a message (the File object) from the HTML container and receive it from the Velo code.

1 Like