Merge pull request #826 from euantorano/featurefix-776

Changing upload_file() to also upload to CDN if enabled as part of #776.
Fixing upload to CDN as move_uploaded_file moves a file rather than copying, so CDN upload never worked.