improvements and flexibility on UploadServlet