HBiSoft / PickiT

An Android library that returns real paths from Uri's

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Return wrong path

HuuNguyen312 opened this issue · comments

Return wrong path

  • After choosing a file from Intent in KakaotalkDownload, but data from pickiT.getPath in Download folder
  • So, I received FileNotFoundException.

Expect
Return path: xxx/KakaotalkDownload/filename

Can it be reproduced in demo app
Yes

Device information

  • Samsung Note 10 Lite
  • SDK version: 29 (Android 10)

Screenshots

Screenshot_20210227-163755_PickiT example
Screenshot_20210227-163730_My Files

I downloaded KakaoTalk, downloaded a file I sent to myself and tested the path in the demo application. I get the correct path: /storage/emulated/0/KakaotalkDownload/test.mp4.

Please share your Intent. I see that you select a .pdf file, but the demo application gives you an option to select a video, so you must have changed the Intent.

This is my Intent

    private void openGallery() {
        //  first check if permissions was granted
        if (checkSelfPermission()) {
            Intent intent = new Intent();
            intent.setType("*/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            intent.putExtra("return-data", true);
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            startActivityForResult(intent, SELECT_VIDEO_REQUEST);
        }
    }

This is block code in my case
return Environment.getExternalStorageDirectory().toString() + "/Download/"+ fileName;

image

I tried using this file by another app (Telegram, kakaotalk, ...). This file can still be read and sent normally.
I can add more log to any code if you need.

Thanks

I was not able to reproduce this. Please download the original demo application (https://github.com/HBiSoft/PickiT/releases/download/0.1.14/PickiTDemo.apk) and select a video file instead of a pdf. Let me know what path you then get.

Closing until more information (asked above) is provided.