vinceglb / FileKit

Pick and save Files, Medias and Folder for Kotlin Multiplatform / KMP and Compose Multiplatform / CMP
https://vinceglb.github.io/FileKit/
MIT License
509 stars 15 forks source link

Good to know, a bit weird that we have to actually create the file and check its path from there when the file can be opened with the name, but idk, Android stuff #126

Open N7ghtm4r3 opened 3 hours ago

N7ghtm4r3 commented 3 hours ago

Good to know, a bit weird that we have to actually create the file and check its path from there when the file can be opened with the name, but idk, Android stuff

Originally posted by @santiwanti in https://github.com/vinceglb/FileKit/issues/118#issuecomment-2377069412

Hi, unfortunately the issue was fixed just for the PickerType.Image(), because with the PickerType.File() the issue is the same.

My launcher is this:

// launcher to pick files
val launcher = rememberFilePickerLauncher(mode = PickerMode.Multiple()) { files ->
files?.forEach { asset ->
     val file = asset.path
   }            
 }

I dont know if the problem is related also whether the mode is PickerMode.Multiple or PickerMode.Single

vinceglb commented 2 hours ago

Hi! I'm not able to reproduce your issue. Can you provide more details about your config:

Thanks for your help 🙏

N7ghtm4r3 commented 2 hours ago

Hi, for sure! I'm using the emulator device Pixel 3aL on Android 14 (API 34). The problem occurs when the file picked is anyway an image, but chosen from the file manager instead of the picker where you can chose only the images or video from the gallery. The extension should be .jpg. With these details and the launcher setup can you reproduce the same scenario I have in my project or you need more specific code?

vinceglb commented 1 hour ago

I used the sample-compose of this repository to try reproducing the issue. Here are the steps I tried:

path = /data/user/0/io.github.vinceglb.sample.compose/files/tanya-yarosh-ErnAQXPG2ns-unsplash.jpg
path = /data/user/0/io.github.vinceglb.sample.compose/files/juan-antonio-guzman-MjYYImZjfpE-unsplash.jpg

Do you have any other information that can help us reproduce the issue?

N7ghtm4r3 commented 1 hour ago

Have you tried also to create a File with that Path? Because me too saw that path, but when I needed to create a file that error occured, I meant the same of the other issue