Added filename checking when uploading.