Correct some alert messages and added some checks, using Javascript, in the upload file functions