now also copies the file to a directory and saves the path to the file