When a file is added, add a check to ensure that the extension has been provided in the path to save and is the same as the extension in the path that is to be read.
In the case that no file name is provided, use the name of the file that is being read.