title: How I can upload photos by Uri instead of File in Android Q using okhttp
body: <p>I'm using Okhttp (com.squareup.okhttp3:okhttp:3.12.10) to upload photos to the server using this code</p>
  <pre><code>MultipartBody.Builder builder = new MultipartBody.Builder()
                      .setType(MultipartBody.FORM)
                      .addFormDataPart(&quot;imageType&quot;, Img_tag)
                      .addFormDataPart(&quot;created&quot;, Calendar.getInstance().getTime() + &quot;&quot;)
                      .addFormDataPart(&quot;comment&quot;, comment + &quot;&quot;))
  
              for (int i = 0; i &lt; IMG_PATHs.size(); count = ++i) {
                  String IMG_Name = IMG_PATHs.get(i).substring(IMG_PATHs.get(i).lastIndexOf(&quot;/&quot;) + 1);
                  String IMG_Extention = IMG_Name.substring((IMG_Name.lastIndexOf(&quot;.&quot;) + 1));
  
                  builder.addFormDataPart(&quot;imageFile&quot; + i, IMG_Name,
                          RequestBody.create(MEDIA_TYPE, new File(IMG_PATHs.get(i))))
                          .addFormDataPart(&quot;ext&quot; + i, IMG_Extention);
              }
              builder.addFormDataPart(&quot;count&quot;, count + &quot;&quot;);
              MultipartBody requestBody = builder.build();
              Request request = new Request.Builder()
                      .url(PTHOT_UPLOAD_PATH)
                      .post(requestBody)
                      .build();
  </code></pre>
  <p>Now after I update to scoped storage in the android Q I have a list of Uri, what should I change to this request to upload the photos?</p>