Convert a file to json