private Response httpsMultPart(String fileParamName, String url, PostParameter[] params, File file, boolean authenticated) throws TBlogException {

        PostMethod post = new PostMethod(url);
        org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient();

        Part[] parts = null;
        if (params == null) {
            parts = new Part[1];
        } else {
            parts = new Part[params.length + 1];
        }
        if (params != null) {
            int i = 0;
            for (PostParameter entry : params) {
                parts[i++] = new StringPart(entry.getName(), (String) entry.getValue());
            }
        }
        FilePart filePart;
        try {

            filePart = new FilePart(fileParamName, file.getName(), file, new MimetypesFileTypeMap().getContentType(file), "UTF-8");
            filePart.setTransferEncoding("binary");
            parts[parts.length - 1] = filePart;
            post.setRequestEntity(new MultipartRequestEntity(parts, post.getParams()));

            if (authenticated) {
                post.addRequestHeader("Authorization", "OAuth2 " + this.oauth2AccessToken);
            }

            client.executeMethod(post);

            Response response = new Response();
            response.setResponseAsString(post.getResponseBodyAsString());
            response.setStatusCode(post.getStatusCode());
            return response;

        } catch (Exception ex) {
            throw new TBlogException(ex.getMessage(), ex, -1);
        } finally {
            post.releaseConnection();
            client = null;
        }
    }