Communication with the server - cURL

Hello, I would like to upload a file to an external server via HTTPS. Earlier, I asked a question how can I establish a connection to an external server to transfer the file. AXC F 2152 connection + external server. I chose the cURL + PBCL_SysLinuxShell (PLCnext Base Library) method. I am familiar with the cURL function but have a few questions about it: 1. Command to upload a file to the server - I found a few commands that are used to upload a file. I’m not sure which one is the most suitable? curl --upload-file http(s):// curl -T http(s):// curl -X POST -F ‘file=@’ http(s):// 2. Using the PBCL_SysLinuxShell function block - how to enter the cURL command into a function block? How should a function block be configured? There is an example in help where the command is STRING. Following the example, the block configuration should look like this? e.g: strCommand := ‘curl --upload-file http(s)://’; PBCL_SysLinuxShell_1( uiResultLength => uiLen, anyCommand := strCommand, anyResult := strResult, xExecute := xExecute, xDone => xDone, xError => xError, wDiagCode => wDiagCode, wAddDiagCode => wAddDiagCode); Kind regards Kacper

Hi Kacper, For question 1, the short answer is “whatever works best for you”. If all those commands work, then the difference between those commands should be explained in the curl help (or elsewhere on the internet) to help you decide which would be the best for your application. Perhaps others in the Community with more experience using curl (or web requests in general) will comment. For question 2, the format of that FB call looks correct. The string passed to the Shell FB is simply any command that works on the command-line of the PLC. Please read the notes in the documentation for this FB, e.g. the command is not called as the admin user, so file permissions (for example) may need to be considered. For questions about this Shell FB and other FBs in the PLCnextBase library, you can get support directly from the developers of this library using the “Contact” button on the app page in the PLCnext Store. ~ Martin.