Skip to content

error whith .withattachment #26

@ragabhesham3

Description

@ragabhesham3

i'm using this code for getting asking user to choose which file he wants to upload
but i cannot know the way for getting the correct path from Uri to put it in .withattachment
can you told me how?

it's kotlin code

`
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == PICK_FROM_GALLERY && resultCode == RESULT_OK) {
imageUri = data?.data!!
}
}

private fun openFilePicker() {
    val i = Intent(
        Intent.ACTION_PICK,
        MediaStore.Images.Media.EXTERNAL_CONTENT_URI
    )
    i.type = "image/*"
    i.putExtra("return-data", true)

    startActivityForResult(i, PICK_FROM_GALLERY)
}

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions