Skip to content

Upload DocumentFile to server #41

@sagarnayak

Description

@sagarnayak

Library version: 0.9.0
OS version: [Android 10]
Device model: [Vivo v11 Pro]

Describe the bug
Getting getAbsolutePath{} as blank but the name is there.

To Reproduce

implementation "com.anggrayudi:storage:0.9.0"

private lateinit var storage: SimpleStorageHelper

storage = SimpleStorageHelper(this)
	storage.onStorageAccessGranted = { _, root ->
		Toast.makeText(
			this,
			getString(
				R.string.ss_selecting_root_path_success_without_open_folder_picker,
				root.getAbsolutePath(this)
			),
			Toast.LENGTH_SHORT
		).show()
	}
		
storage.onFileSelected = { _, file ->
	Toast.makeText(baseContext, "File selected: ${file.fullName}", Toast.LENGTH_SHORT)
	.show()
	val fileLocation = file.getAbsolutePath(this@UploadDocument)
	logUtil.logV(">>>>> the name is : ${file.name}")
	logUtil.logV(">>>>> if file : ${file.isFile}")
	logUtil.logV(">>>>> the location : $fileLocation")
	gotFile(
		File(fileLocation)
	)
}

storage.openFilePicker(REQUEST_CODE_PICK_FILE, "image/*", "application/pdf")

Stacktrace

V: >>>>> the name is : IMG-20210712-WA0000.jpg
V: >>>>> if file : true
V: >>>>> the location : 

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions