Reputation: 1813
Error description:
File does not exist: content:/com.alphainventor.filemanager.fileprovider/root/storage/emulated/0/Bollywood%20Mix/Old/Audio.mp3
I am using below dependency to create zip file:
implementation 'net.lingala.zip4j:zip4j:2.9.0'
Code used is as below:
fun zipAudios(context: Context, fileUrls: ArrayList<String>): File? {
val zipfileCreated = createFile(
getOutputDirectory(context),
"yyyy-MM-dd-HH-mm-ss-SSS",
".zip"
)
// Create a buffer for reading the files
try {
// create the ZIP file
val zipfile = ZipFile(zipfileCreated, null)
for (i in fileUrls.indices) {
zipfile.addFile(File(fileUrls[i]))
}
return zipfile.file
} catch (ex: IOException) {
System.err.println(ex.message)
}
return null
}
I have some questions regarding the same:
Upvotes: 0
Views: 2750