Modify a document in an application page

Hello,

I'm trying to have an application page which allows some user to modify some documents in a case.

First I'm retrieving the documents to modify using this API in a table :

../API/bpm/caseDocument?p=0&c=10&f=name=nomDoc&f=caseId={{caseId}}

Then I'm using an upload widget with the default URL in order to upload the new version: ../API/formFileUpload

And finally I have a button to execute the update with a PUT request to ../API/bpm/caseDocument/{{selectionDoc.id}} and a json payload filled with "file" and "description"

When I click the button, I get the exception message : Cannot find newFile.txt in the tenant temp directory.

 

How could I fix this?

You must use the value of ` tempPath` returned by the `API/formFileUpload` POST call as the `file` attribute of the PUT call to `../API/bpm/caseDocument/{{selectionDoc.id}}`

tempPath is the filename use on the server filesystem of the uploaded file. As stated by the documentation, you can use the `fileName` attribute of the PUT `../API/bpm/caseDocument/{{selectionDoc.id}}` payload to rename the file.

HTH

Romain

Thank you, that was the part I missed!