throws ClientServicesException {
Object contents = args.getHandler();
if(contents instanceof File){
String name = args.getParameters().get("file");
FileEntity fileEnt = new FileEntity((File) contents, getMimeForUpload());
//fileEnt.setContentEncoding(FORMAT_BINARY);
httpRequestBase.setHeader("slug", name);
httpRequestBase.setHeader("Content-type", getMimeForUpload());
if (fileEnt != null && (httpRequestBase instanceof HttpEntityEnclosingRequestBase)) {
((HttpEntityEnclosingRequestBase) httpRequestBase).setEntity(fileEnt);