In PHP > 5.5 class CurlFile should be used for file upload