Best practice to upload files on server using Rest Service
The lines of code inside your UploadFile method look optimal to me.

Perhaps the problem is that your Stream contents are being fully buffered before they're being delivered.

I've no experience with this myself, but
How to: Enable Streaming suggests you may need to change your configured TransferMode, and change your API so that it has a method whose only parameter is Stream (perhaps pass the filename in one method and the Stream in the next method).