title: Failed to upload camera image file on aws s3
body: <p>Unable to upload image path to s3 in android</p>
  
  <pre><code>content:/com.earlysalary.android.provider/external_files/IMG_20180523_164228_1998498766.jpg
  </code></pre>
  
  <p>I am using FileProvider for getting uri of camera image.
  getting invalid file exception while try to upload on S3 of above uri.</p>
  
  <pre><code>String authorities = mContext.getPackageName();
  Uri  imgUri = FileProvider.getUriForFile(getContext(), authorities +".provider", photoFile);
  </code></pre>
  
  <p>For uploading on s3 I am using</p>
  
  <pre><code> File uploadFile = new File(imgUri .getPath());
  
     TransferObserver transferObserver = transferUtility.upload("my_bucket", bucketFilePath, uploadFile, CannedAccessControlList.PublicRead);{
  
  }
  </code></pre>
  
  <p>getting error</p>
  
  <pre><code>System.err: java.lang.IllegalArgumentException: Invalid file: content:/com.example.android.provider/external_files/IMG_20180523_164228_1998498766.jpg
  05-23 16:43:45.931 30128-30128/com.earlysalary.android W/System.err:     at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.upload(TransferUtility.java:532)
  05-23 16:43:45.931 30128-30128/com.earlysalary.android W/System.err:     at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.upload(TransferUtility.java:497)
  05-23 16:43:45.931 30128-30128/com.earlysalary.android W/System.err:     at com.amazonaws.mobileconnectors.s3.transferutility.TransferUtility.upload(TransferUtility.java:436)
  </code></pre>