Changing upload_file() to also upload to CDN if enabled as part of #776.