Open faezeh1378 opened 1 month ago
If I am correct thinking what you are trying to do, here are some things we did:
upload
API because iOS when using camera capture does not create unique filename (always image.jpg
) which causes multi-file issues. The code is really just a copy of the native File component upload
method with that filename check;getFile
method to retrieve the file via our API which uses a Bearer token;uploadFile
, deleteFile
and downloadFile
methods to hit our API correctly. This URL Storage Provider is used to override the Providers.providers.storage.url
entry.We did this via monkey patching which is not great; we use Angular 16 however the type definitions in Formio 14.X leave something to be desired, and monkey patching was easier (!). I think Formio 5.X will address type definitions.
The above works fine for an browser app with a separate API server (handled by your own code). Issues we ran into:
Sorry for the long reply. Use the existing File component and URL Storage Provider classes of Formio as your templates.
Hello I want to create a custom file component in which I can have more than one url address and I can use my own token and request header to access those addresses. for example authorization: Bearer ${window.localStorage.getItem('token')} How can I do this? i use formiojs@4.14.13 Thanks