Added ability to pass and display upload error messages. Added conditional constant definitions to upload script.