Need help to upload file using multipart/form data
<p>I'm facing problem to upload a file using multipart form data. I have given the screenshot of ARC with the API and my present code. Can anyone give me the proper way how to upload file using this multipart form data.</p>

<p><img src="https://i.stack.imgur.com/6KjP5.png" alt=""></p>

<pre class="lang-java prettyprint-override"><code>public class MultiPortRequest&lt;T&gt; extends Request&lt;T&gt; {

private static final String FILE_PART_NAME = "file";

private MultipartEntityBuilder mBuilder = MultipartEntityBuilder.create();
private final Response.Listener&lt;String&gt; mListener;
private final File mImageFile;
protected Map&lt;String, String&gt; headers;

public MultiPortRequest(String url,Response.Listener&lt;String&gt; listener,
                             ErrorListener errorListener,

                             File imageFile)
{
    super(Method.POST, url, errorListener);

    mListener = listener;
    mImageFile = imageFile;

    buildMultipartEntity();
}

@Override
    public Map&lt;String, String&gt; getHeaders() throws AuthFailureError {
    Map&lt;String, String&gt; headers = super.getHeaders();

    if (headers == null
            || headers.equals(Collections.emptyMap())) {
        headers = new HashMap&lt;String, String&gt;();
    }

    headers.put("Identity", "rHTYsg8vZ/KWTaGOsy0eMNhngJMiZiK60pd9jAUQ+fI=");

    return headers;
}

private void buildMultipartEntity()
{
    mBuilder.addBinaryBody(FILE_PART_NAME, mImageFile, ContentType.create("multipart/form-data"),
            mImageFile.getName());

    mBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
    mBuilder.setLaxMode().setBoundary("xx").setCharset(Charset.forName("UTF-8"));
}

@Override
public String getBodyContentType()
{
    String contentTypeHeader = mBuilder.build().getContentType().getValue();
    return contentTypeHeader;
}

@Override
public byte[] getBody() throws AuthFailureError{
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    try{
        mBuilder.build().writeTo(bos);
    }
    catch (IOException e)
    {
        VolleyLog.e("IOException writing to ByteArrayOutputStream bos, building the multipart request.");
    }

    return bos.toByteArray();
}

@Override
protected Response&lt;T&gt; parseNetworkResponse(NetworkResponse response){
    try {
        String result = null;
        result = new String( response.data, HttpHeaderParser.parseCharset( response.headers ) );
        return ( Response&lt;T&gt; ) Response.success( new JSONObject( result ), HttpHeaderParser.parseCacheHeaders(response) );
    } catch ( UnsupportedEncodingException e ) {
        return Response.error(new ParseError(e));
    } catch (JSONException je) {
        return Response.error(new ParseError(je));
    }
}

@Override
protected void deliverResponse(T response){
    mListener.onResponse( response.toString());
    Log.v("yes", String.valueOf(mListener));
}
}
</code></pre>