Minimal photo upload
The Minimal Photo Upload App lets users scan a barcode as an order number, add a name, attach up to 10 photos, and send them directly to a local computer running a Native Agent.
Frontend

The frontend includes a form widget to enter an order ID (which users can also scan using the barcode / QR widget) and a name. Users can then upload photos from their gallery or file system, or take them directly with the camera. Once all information is available, the Save to server button widget becomes active and transfers the files to a local computer running a Native Agent with the File I/O connector.
Backend

Form auto-fill: The optional barcode scan uses the
autofillcommand to populate the form directly.Form data receipt: An
echofunction receives the form data. This lets the flow trigger on page load to run the connected validation routine, which enables the upload button.Photo retrieval: A second
echofunction retrieves the uploaded photos. This function uses theFilestorage option because camera images can exceed 5 MB, and buffers perform poorly on large files.Sequential file processing: Drag the
readFileToBufferfunction from your Native Agent onto the canvas. It receives an array of file paths from the upload widget and processes them sequentially into a base64 buffer on the backend to write them to theimagedirectory. When configured this way, the system interprets the path relative to the Native Agent executable.UI feedback: To improve the user experience, the button shows a loading animation until the files arrive on the server. Call the
doneevent on the button widget to stop this animation and clear the widgets after a successful upload.
Step-by-step guide
Install the Native Agent
Install a Native Agent on the computer that will receive the uploaded photos. Ensure the File I/O connector is configured and active.
Import the template
Open the App Builder.
Click the tags menu in the Top Bar.
Select Import and upload the
minimal-photo-uploader.hwtfile.Select the imported template and confirm the import.
Last updated
Was this helpful?