Replies: 4 comments 1 reply
-
|
I am also very interested |
Beta Was this translation helpful? Give feedback.
-
|
FileKit does not write to the public downloads folder. for that you need MediaStore directly: val values = ContentValues().apply {
put(MediaStore.Downloads.DISPLAY_NAME, "yourfile.pdf")
put(MediaStore.Downloads.MIME_TYPE, "application/pdf")
put(MediaStore.Downloads.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS)
}
val uri = context.contentResolver.insert(MediaStore.Downloads.EXTERNAL_CONTENT_URI, values)
uri?.let { context.contentResolver.openOutputStream(it)?.use { out -> out.write(bytes) } }requires API 29+. on older versions you would use |
Beta Was this translation helpful? Give feedback.
-
|
got it, makes sense. the MediaStore approach works as a workaround for now but a built-in |
Beta Was this translation helpful? Give feedback.
-
|
Hi @faraz152 ! I will do It! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, is there a way to directly save a file into the DIRECTORY_DOWNLOADS folder or more in general in any directory available with the
getExternalStoragePublicDirectorymethod?Beta Was this translation helpful? Give feedback.
All reactions