check file extension on upload and output json