Closed dorkytiger closed 10 hours ago
Where are you obtaining that path?
I use this function get the path,because I want to save the file info in local database, and when I need it I convert it to IPlatformFile
actual fun getAbsolutePath(file: IPlatformFile): String {
return file.getAbsolutePath()
}
But where are you getting this file from? What's the source?
But where are you getting this file from? What's the source?
this,i get from it
val filePicker = rememberFilePickerLauncher(
type = PickerType.File(listOf("pdf")),
mode = PickerMode.Single,
title = "Select a PDF file",
) { pdfFile ->
scope.launch {
withContext(Dispatchers.IO) {
pdfFile?.toKmpFile()?.let {
viewModel.onAction(
UploadFormAction.CreateUploadTask(
UploadEntity(
userId = user?.userId ?: 0,
type = selectFileType,
skipSameNameFolder = skipSameNameFolder,
libraryId = selectLibrary?.libraryId ?: 0,
pathUrl = FileUtil.getAbsolutePath(it),
title = it.getName()
)
)
)
navigator.dispose(UploadScreen())
navigator.push(UploadScreen())
}
}
}
}
val directoryPicker = rememberDirectoryPickerLauncher(
title = "Select a Directory"
) { directory ->
scope.launch {
withContext(Dispatchers.IO) {
directory?.toKmpFile()?.let {
viewModel.onAction(
UploadFormAction.CreateUploadTask(
UploadEntity(
title = it.getName(),
userId = user?.userId ?: 0,
type = selectFileType,
skipSameNameFolder = skipSameNameFolder,
libraryId = selectLibrary?.libraryId ?: 0,
pathUrl = FileUtil.getAbsolutePath(it),
)
)
)
navigator.dispose(UploadScreen())
navigator.push(UploadScreen())
}
}
}
}
Can you try 0.6.3 once it's published?
Can you try 0.6.3 once it's published?
Thinks! of course i will try it ,if it fix, i will tell you
Can you try 0.6.3 once it's published?
it work!thank you for your help!
I tried running it separately on the iOS simulator and the real iOS device. The simulator had no issues, but the real device reported an error saying :
Did I miss setting any permissions? Below is the code I ran: