Wouldn't it be easier to unmarshal into a map? So you send the files as a JSON object of filename => contents.