Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

MediaFile with empty name after upgrade to 1.3.0 version #45

Closed
H-Mezri opened this issue Nov 26, 2019 · 22 comments
Closed

MediaFile with empty name after upgrade to 1.3.0 version #45

H-Mezri opened this issue Nov 26, 2019 · 22 comments

Comments

@H-Mezri
Copy link

H-Mezri commented Nov 26, 2019

Describe the bug
After upgrading to 1.3.0 version, mediaFiles returned from FilePicker Activity have null as name attribut.
Also, files shown in the file picker without name. (see the screenshots)

To Reproduce
Steps to reproduce the behavior:

  1. upgrade to 1.3.0
  2. choose file
  3. mediaFile.name -> is null

Screenshots
Version 1.2.2:
Screenshot_1574763107

Version 1.3.0:
Screenshot_1574762681

Android info (please complete the following information):

  • Emulator & One plus 6
  • API 29 / API 28
@jaiselrahman
Copy link
Owner

The issue has been fixed in version 1.3.1. Please check it out.

@PembaTamang
Copy link

hey I am still seeing this issue in 1.3.1 it is a samsung galaxy j7 running android 6.0.1.

No name is being displayed

@jaiselrahman
Copy link
Owner

Did you try clean rebuild?

@PembaTamang
Copy link

yes I tried I am due to show my app tomorrow can you give a fix??

@PembaTamang
Copy link

here is the config
intent.putExtra(
FilePickerActivity.CONFIGS, Configurations.Builder()
.setCheckPermission(true)
.setShowImages(false)
.setShowFiles(true)
.setShowVideos(false)
.setShowAudios(false)
.setSuffixes("pdf")
.enableImageCapture(false)
.setMaxSelection(1)
.setSkipZeroSizeFiles(true)
.build()

@PembaTamang
Copy link

can you reproduce the issue ??

@jaiselrahman
Copy link
Owner

jaiselrahman commented Dec 16, 2019

No, I couldn't reproduce the issue.

Can you log the result of files selected in onActivityResult method, something like this

ArrayList<MediaFile> files = data.getParcelableArrayListExtra(FilePickerActivity.MEDIA_FILES);
for(MediaFile f: files){
    Log.d(TAG, "Name " + f.getName());
    Log.d(TAG, "Path " + f.getPath());
    Log.d(TAG, "Uri " + f.getUri());
}

@PembaTamang
Copy link

I am sorry that was my colleague's phone and I can use it only tomorrow but I remember that the name and path was coming correctly as I displayed the name on a textview and I used the path to upload it to a server. The only issue was that the names were not showing and could not see what file I was choosing

@jaiselrahman
Copy link
Owner

Are you overriding any theme, may be it was issue with the theming.

@PembaTamang
Copy link

Nope I have a another device with resurrection remix 5.7.1 based on marshmallow and it is working properly there. Can it be an issue with Samsung devices?

@PembaTamang
Copy link

PembaTamang commented Dec 18, 2019

No, I couldn't reproduce the issue.

Can you log the result of files selected in onActivityResult method, something like this

ArrayList<MediaFile> files = data.getParcelableArrayListExtra(FilePickerActivity.MEDIA_FILES);
for(MediaFile f: files){
    Log.d(TAG, "Name " + f.getName());
    Log.d(TAG, "Path " + f.getPath());
    Log.d(TAG, "Uri " + f.getUri());
}

My HTC 816 running resurrection remix 5.7.1 based on android 6.0.1 : Working properly

 path /storage/emulated/0/Download/sample.pdf
 name sample.pdf
 uri content://media/external/file/37327

Samsung galaxy j7 with android 6.0.1: The file names in the UI are blank like the screenshots posted above

 path /storage/emulated/0/annual_report_2009.pdf
 name annual_report_2009.pdf
 uri content://media/external/file/51946

Sorry for the late reply

@jaiselrahman
Copy link
Owner

Thanks you,
So the file name is read properly, the issue seems to be in displaying them.

@jaiselrahman
Copy link
Owner

jaiselrahman commented Dec 18, 2019

Can you try out the following apk, select one of the pdf file and share the log using the menu.

https://drive.google.com/open?id=1UCxODyt4QC9xQejNNS0grpaVEKgJx3L-

@PembaTamang
Copy link

Thanks you,
So the file name is read properly, the issue seems to be in displaying them.

yes

@PembaTamang
Copy link

Can you try out the following apk, select one of the pdf file and share the log using the menu.

https://drive.google.com/open?id=1UCxODyt4QC9xQejNNS0grpaVEKgJx3L-

here it is
logcat.txt

@jaiselrahman
Copy link
Owner

Thank you. The issue is with the MEDIA_TYPE not read properly.
Will fix it soon.

@PembaTamang
Copy link

ok . thank you for responding so well

@jaiselrahman
Copy link
Owner

Welcome,
Can you check the following version works

com.github.jaiselrahman:FilePicker:issue_45-SNAPSHOT

@PembaTamang
Copy link

yes its working!! Thank you so much

Welcome,
Can you check the following version works

com.github.jaiselrahman:FilePicker:issue_45-SNAPSHOT

Yes, it is working now!! Thank you so much

jaiselrahman added a commit that referenced this issue Dec 18, 2019
@jaiselrahman
Copy link
Owner

Version 1.3.2 released with the fix.
Thanks for your cooperation.

@PembaTamang
Copy link

welcome. Thank you for responding so quickly

@jafar5029
Copy link

jafar5029 commented Jun 2, 2022

Not working for document upload(pdf) , path giving null
Log is Given Below
--------- beginning of system
06-02 19:47:54.369 18260 18260 E OplusCustomizeRestrictionManager: sInstance is null, start a new sInstance
--------- beginning of main
06-02 19:47:59.680 18260 18260 D FilePicker: Name : PatientReport1.pdf
06-02 19:47:59.680 18260 18260 D FilePicker: Path : null
06-02 19:47:59.680 18260 18260 D FilePicker: MediaType : 0
06-02 19:47:59.680 18260 18260 D FilePicker: Mime : application/pdf
06-02 19:47:59.680 18260 18260 D FilePicker: MediaType After double check : 0
06-02 19:47:59.680 18260 18260 D FilePicker: MediaType in mediastore : 0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants