ns=2;s=DEPRAG Smart/Network/HTTP/REST/ActiveClients/0/FileUpload
Uploads a file to the specified endpoint.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bHttpFileUpload : BOOL;
OutputDataHttpFileUpload : ST_HttpResultWithStringContentOutputData;
hrHttpFileUpload : HRESULT;
testLongByteArray : ARRAY[1..1000] OF BYTE := [84, 101, 115, 116, 255, 84, 101, 115, 255];
fbHttpRest : FB_HttpRest;
END_VAR
hrHttpFileUpload := fbHttpRest.FileUpload(
bExecute := bHttpFileUpload,
ConnectionHandle:= depragSmartConnection.ConnectionHandle,
sRequestUri := '/testFileUpload',
Content := testLongByteArray,
nContentLength := 9,
sClientId := '0',
OutputData => OutputDataHttpFileUpload);
IF hrHttpFileUpload <> S_FALSE THEN
bHttpFileUpload := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".