android-image-picker
android-image-picker copied to clipboard
Send image using retrofit
How do we send the returned Image object from getFirstImageOrNull using retrofit?
Can we get the path (or) File object of this image?
Use image.getPath() to get the image path. You can find a full tutorial here https://androidclarified.com/android-image-upload-example/
Thank you @PiwanSama . I used
File file = new File(image.getPath).
RequestBody fileToUpload = RequestBody.create(MediaType.parse("*/*"),file);
If anyone trying to figure out get the image from a URI, please refer to this https://github.com/esafirm/android-image-picker/issues/307#issuecomment-1320995444