Changing upload_file() to also upload to CDN if enabled.
Merge pull request #826 from euantorano/featurefix-776

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