Modify a document in an application page



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 :


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/{{}} 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?

1 answer

This one is the BEST answer!

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/{{}}`

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/{{}}` payload to rename the file.




Submitted by torea_1402565 on Tue, 06/02/2020 - 19:33

Thank you, that was the part I missed!