Added curl upload support for PHP 5.6+.