There is one more way to check correctness ot the sent file:
- Calculate expected size of the file:
pub.string:bytesToString (input: *content (file to send) as “*bytes”; output: StringToSend as string)
pub.string:length (input: StringToSend as InString; output: SentBytes as value)
prepare pattern for LS:
pub.string:concat (input: "-la " as inString1, as inString2; output: FileToSearch as value)
REPEAT (count = 5):
3.1 pub.client.ftp:put (input: *content, , transfermode = binary)
3.2 pub.client.ftp:ls (input: FileToSearch (from step 2) as filenamepattern; output: dirlist)
3.3 LOOP over /dirlist (there is only one item in this one):
3.3.1 pub.string:tokenize (input: dirlist as inString, empty delim; output: valueList)
3.3.2 Get Length of sent file from response of LS:
pub.list:getStringListItem (input: valueList as list, “4” as item; output: item) - if file exists, then 4-th item is the size of this file, else - file doesn’t exist.
3.3.3 BRANCH (evaluate-labels = “true”) - compare size of sent file with expected length.
220.127.116.11 SEQUENCE (label = %/SentBytes%=%/item%) - PUT is successful, make appropriate actions and exit from REPEAT (step 3)
18.104.22.168 SEQUENCE (label = $default) - File doesn’t exist or transfer of the file doesn’t complete. Make appropriate actions (and repeat the PUT and checking - go to step 3.1)