Upload DocumentFile to server
See original GitHub issueLibrary 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 :
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to get file from 'DocumentFile' and send that file to server ...
How to get file from 'DocumentFile' and send that file to server using retrofit ... createChooser(intent, "Select a File to Upload"), ...
Read more >UPLOADING PDF FILE TO SERVER USING RETROFIT IN ...
This wrap up the the Android uploading media file to server using Retrofit. Pdf upload takes cognizance of the use of nbsp -...
Read more >Upload Files To Server Using Retrofit 2 In Android - C# Corner
In this article, we will learn how to upload any file to an online server using Retrofit 2 in Android.
Read more >coder/code-server - Document file uploading in FAQ - GitHub
Hi, I am using the code-server on my ububuntu azure host for some weeks now, but i have allot of local projects on...
Read more >Simple File Upload - Server 2022 - Relativity Documentation
Simple File Upload, formerly Single File Upload, gives users the ability to add new documents to Relativity without using the Relativity Desktop Client....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can read the file via
InputStream
:DocumentFile.type
orDocumentFile.mimeTypeByFileName
.DocumentFile.length()
orDocumentFile.getFormattedSize()