I setup a component that correctly uploads files to the backend but it uploads the file any time you visit the form. Clearly I have made some mistake but I can't find where.
When you select an image or drop it, the image is loaded to the server and the preview is correctly displayed, when you visit a form that has already an image defined I populate the files attribute with an array with a single filepath, i.e.:I strip the host part and leave the path as in /media/my_image.png. The widget correctly shows the name and "Upload completed" (with green background), but doesn't show the image. My guess is that it can't understand the match between the complete name and the 'url' computed value. Am I wrong? what's the proper way to pass it?
FilePond will try to load the file data from the server using the server.load end-point or the server.restore end-point depending on the type of file (local or limbo).
I setup a component that correctly uploads files to the backend but it uploads the file any time you visit the form. Clearly I have made some mistake but I can't find where.
My component is roughly:
The script is:
When you select an image or drop it, the image is loaded to the server and the preview is correctly displayed, when you visit a form that has already an image defined I populate the files attribute with an array with a single filepath, i.e.:I strip the host part and leave the path as in /media/my_image.png. The widget correctly shows the name and "Upload completed" (with green background), but doesn't show the image. My guess is that it can't understand the match between the complete name and the 'url' computed value. Am I wrong? what's the proper way to pass it?