Hi @mjokela,
Are you sure $fileData contains a valid path on disk?
I recommend creating a PHP snippet that accepts the file path as the first arg and makes all the needed requests and executing it from a shell on that server. Let’s see how that goes. If that too fails, it will still be easier to debug than a flow that involves submitting a form in browser context, if it succeeds then at least you’ve isolated the issue.