Adds error checking to upload when a file is not provided.