Removed http_build_query($data) on curl post and put because it isn't needed and since PHP 5.2.0 it doesn't work anymore with files.