remove path to the dir to export in the name of the file saved
manage if path end by "/" or not