Implement fix for bug #46439 - add CURLFile class for safer uploads