Closed hoahai closed 2 months ago
What path do you mean? I don't think the file is saved anywhere at this point; it just resides in memory as some JS variable - just like with a valu from any input component. You can take this value and upload it via REST or other API straight to cloud (or some database, I guess). So I think storing it as base64 is perfectly fine choice - we don't need the binary representation of the file anywhere in the app.
Some API such as Dropbox doesn't accept base64. Do you have any idea on how to upload the file to such server, especially via https REST API?
We do have the Restful API Query, where you can set the Body mode to form and then attach a file. Based on that and a (yes a bit cryptically) way to tell the backend (api-service) how to treat a file, you can achieve the sending of the file as binary content. However, in the app (browser) it will be still indeed a base64 encoded file.
You will need this (similar) formulation in combination with the file uploader component:
{{ {data: file1.value[0], name: file1.files[0].name} }}
Currently, the File Upload Components will automatically encode the file to base64. There are also no path to file. This makes it hard to upload the file to Cloud Storage.
How can we, as app Editor/Developer, get the file and upload it to other Cloud storage such as Dropbox?