I have seen a lot of examples on how upload files with cURL (Send file with cURL being probably the closest to what I need), but for whatever reason my scripts are not working.<
Removing http_build_query() and keeping '@' in front of the file name did it. I am not quite sure what fixed the "does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit" error, but the file is received and parsed properly on SERVER2 now.