json encode list of files

json encode list of files, fix for #2150