Accept array as well as file name