Fix creating entity with dupe and file params

A boundary will not be written after the last file params. If there are additional dupe params, they do not get added to the entity properly. Switching the order and adding the file params last fixes this issue.
Merge pull request #185 from davidwen/patch-1

Fix creating entity with dupe and file params