title: Already generated AWS signedUrl not working with Android Retrofit2 call for upload videos(mp4)
body: <p>I have a signed url came from AWS.</p>
  <p>I use the below code to upload my mp4 file.</p>
  <pre><code> val retrofit = Retrofit.Builder()
              .baseUrl(&quot;https://www.DUMMEY.com/&quot;) // THIS BASE URL AUTOMATICALLY REPLACE ONCE RETROFIT INTERFACE BODY ATTACH WITH @URL
              .addConverterFactory(GsonConverterFactory.create())
              .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
              .build()
  
          val videoInterface = retrofit.create(
              FileUploadService::class.java
          )
  
          var apiResponse: Call&lt;Void&gt;
          val requestBody = activity.contentResolver.readAsRequestBody(fileUri)
          apiResponse = videoInterface.upload(
              &quot;video/mp4&quot;,
              &quot;Android-OS&quot;,
              signedurl,
              requestBody
          )
          apiResponse.enqueue(object : Callback&lt;Void&gt; {
              override fun onResponse(
                  call: Call&lt;Void&gt;,
                  response: Response&lt;Void&gt;
              ) {
                  Log.d(&quot;SUCCESS&quot;, &quot;=========API RESPONE SUCCESS=========&quot; + apiResponse)
              }
  
              override fun onFailure(call: Call&lt;Void&gt;, t: Throwable) {
                  Log.e(&quot;FAILED&quot;, &quot;=========API RESPONE FAILED=========&quot; + apiResponse)
              }
  
          })
      }.start()
  
  
  
  fun ContentResolver.readAsRequestBody(uri: Uri): RequestBody =
      object : RequestBody() {
          override fun contentType(): MediaType? =
              this@readAsRequestBody.getType(uri)?.toMediaTypeOrNull()
  
          override fun writeTo(sink: BufferedSink) {
              this@readAsRequestBody.openInputStream(uri)?.source()?.use(sink::writeAll)
          }
  
          override fun contentLength(): Long =
              this@readAsRequestBody.query(uri, null, null, null, null)?.use { cursor -&gt;
                  val sizeColumnIndex: Int = cursor.getColumnIndex(SIZE)
                  cursor.moveToFirst()
                  cursor.getLong(sizeColumnIndex)
              } ?: super.contentLength()
      }
  
  interface FileUploadService {
  @PUT
  fun upload(
      @Header(&quot;Content-Type&quot;) contentType: String?,
      @Header(&quot;User-Agent&quot;) userAgent: String?,
      @Url signingUrl: String?,
      @Body file: RequestBody
  ): Call&lt;Void&gt;
  </code></pre>
  <p>}</p>
  <p>But still, I couldn't success with this.</p>
  <p>I'm getting &quot;javax.net.ssl.SSLException: Write error: ssl=0xe8abb908: I/O error during system call, Broken pipe&quot; this error all time when running the code. (But I feel this is not only an SSLException, but there is a huge mistake on my code also)</p>
  <p>As per the Postman output, it should response &quot;1&quot; with 200 OK.</p>
  <p>And I tried with &quot;Multipart.Part&quot; for my file also using this code.</p>
  <pre><code>   val file = File(fileUri!!.path!!)
     val requestBody = InputStreamRequestBody(activity.contentResolver, fileUri)
     val filePart = MultipartBody.Part.createFormData(&quot;file&quot;, file.name, requestBody)
  </code></pre>
  <p>Interface is..</p>
  <pre><code> @Multipart
  @PUT
  fun uploadHope(
      @Header(&quot;Content-Type&quot;) contentType: String?,
      @Header(&quot;User-Agent&quot;) userAgent: String?,
      @Url signingUrl: String?,
      @Part file: MultipartBody.Part
  ): Call&lt;Void&gt;
  </code></pre>
  <p>The same error occurred.</p>
  <p>I followed this <a href="https://gutier.io/post/android-upload-file-to-aws-s3-bucket-with-retrofit2/" rel="nofollow noreferrer">blog</a> as a help.</p>
  <p>Please help me to take &quot;Upload Success&quot; on this.</p>