TRIRIGA

 View Only

 Uploading photos in Work Task comments using UX via Node

Emerson David's profile image
Emerson David posted Thu February 13, 2025 06:01 PM

Greetings,

I'm looking to duplicate how the out-of-the-box Polymer Work Task app uploads photos to TRIRIGA as comments. I can see the code to upload in triview-worktask.js, but don't understand how it works. I'm using Node/React. Anyone have any guidance?

-emerson

Naveendran P's profile image
Naveendran P

Hi Emerson, 

The Polymer image upload works based on following api's

/p/fileupload/maximumFileSizeForUpload   - Get request to retrieve the max file size configured in web property

/p/fileupload/validImageExtensions         - Get request to retrieve the include and exclude file extension configured in web property

/p/fileupload/uploadimage   -     Post Request to upload the image to the server 

To understand in details about this you can check the <triplat-image> web component all protected methods (but do check _doUploadFile for sure)

I am not sure whether @tririga/tririga-react-components has api or component to upload the file, but it does have one for downloading the image. But you can use the above api's and create a component or api for uploading image.