Integrity of the file after transfer isn't the problem.
(I seem to recall there being a way for the server to reliably guess whether the file was being piped or saved to disc, as well, which would let you restrict the malicious version even more. Google is failing me at the moment, though.)
https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b...