title: How to send image as POST in android studio
body: <p>I have to send an image from app to PHP server along with few details.
  I have written below code to send the details, but not sure how to send the image. Can anyone help me with this please ?</p>
  
  <p>As you can see, i am using Map to send data to server. But how to add image in this. Any help would be helpful.</p>
  
  <pre><code>StringRequest strReq = new StringRequest(Request.Method.POST, "URL", 
          new Response.Listener&lt;String&gt;() {
              @Override
              public void onResponse(String response)
              {
                 Toast.makeText(getApplicationContext(), "Response", Toast.LENGTH_LONG).show();
              }
          }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {     
                 Toast.makeText(getApplicationContext(),"Response", Toast.LENGTH_LONG).show();
              }
          })
          {
              @Override
              protected Map&lt;String, String&gt; getParams() {
                  Map&lt;String, String&gt; details =  new HashMap&lt;&gt;();
                  details.put("id", session.getKey());
                  details.put("name", name.toString());
                  return details;
              }
          };
  strReq.setShouldCache(false);
  AppController.getInstance().addToRequestQueue(strReq);
  </code></pre>