Hi Aarthi,
What Works in PWA with Mendix:
Image upload & viewer – Confirmed working.
Standard file uploads – Have limitations especially in offline PWAs, and for binary files like audio/video.
Recommended Approach:
Use a JavaScript Action to access the device's file system via <input type="file"> and convert the selected file (audio/video) to Base64.
Store the file temporarily in a non-persistable entity with attributes: FileName, MimeType, Base64String, Type (Audio/Video).
When back online, use a Nanoflow + Microflow to:
Decode the Base64 string.
Save it as a FileDocument or a custom entity (e.g.,VideoFile) inheriting from FileDocument).
Commit it to the Mendix DB.
For playback, use HTML5 <audio> or <video> tags or relevant widgets to stream the file (admins only).
Helpful Tools:
Base64 File Handling Module
JavaScript Action (FileReader API)
HTMLSnippet or Video/Audio Player widgets
This method ensures compatibility with offline PWAs, including iOS Safari limitations.
I hope this one helps you! :)