Simplify upload code on the server