Fix for new curl file upload method.

http://stackoverflow.com/a/17033048/372215