Modify a document in an application page

1
0
-1

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?

1 answer

1
+1
-1
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/{{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

Comments

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

Thank you, that was the part I missed!

Notifications