You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attachments are saved, however the Image Attachment control cannot show an image that has been attached, both:
just after having attached, which means that we have a File object at our disposal (upload: scheme)
after saving the data, which means that we have no File but a path to the persistence layer
In online mode, an <img> HTML object requests data to the XForms servers, which then proxies this appropriately to either the temporary file or the data from the persistence layer. In offline we do not have a server that can do this kind of proxying.
figure out mechanism whereby we can create the image object
When we have a File object, we can use URL.createObjectURL(). This should cover showing the image and downloading the file (with <a download>?).
We could probably make this work even after saving the data.
However, this won't work if the form is closed and reopened, as in that case we have a ReadableStream and that cannot be transformed into a URL. That could be an acceptable limitation as a first step, but not ideal in general.
However:
Attachments: we could disable the Download link in such cases.
Images: we could read them and transform them into a Blob if they are not too large. After all, they will have to be uncompressed and shown in the browser eventually.
Videos: not needed right now; could MediaSource help? For smaller videos, we could do what we do for images. But videos tend to be be much larger than images, in the order of GBs vs. MBs.
ebruchez
changed the title
Offline: Image Attachment and Attachment controls to support data retrieval
Offline: Image Attachment and Attachment controls to support initial data retrieval
Feb 21, 2024
Changed title to indicate that the data retrieval now works for attachments in the same session where they have been attached. We don't yet support reading such attachments from persistence in a new form session.
ebruchez
changed the title
Offline: Image Attachment and Attachment controls to support initial data retrieval
Offline: Image Attachment/Attachment to show/download content after attaching
Feb 22, 2024
Following #5207.
Attachments are saved, however the Image Attachment control cannot show an image that has been attached, both:
File
object at our disposal (upload:
scheme)File
but a path to the persistence layerIn online mode, an
<img>
HTML object requests data to the XForms servers, which then proxies this appropriately to either the temporary file or the data from the persistence layer. In offline we do not have a server that can do this kind of proxying.fr:attachment
: usedownload
attribute #6198The text was updated successfully, but these errors were encountered: