react-native-documents / document-picker

Document Picker for React Native
https://react-native-documents.github.io/
MIT License
1.35k stars 441 forks source link

Does picker gives different responses for different type of files #516

Closed LoveWithCoding closed 2 years ago

LoveWithCoding commented 2 years ago

Bug report

Summary

Document Picker is giving different responses for different type of file formats

Reproducible sample code

This is simple code snippet as shown below

let DocumentPickerResponse = await DocumentPicker.pick({
 type: [DocumentPicker.types.allFiles]      
});

console.log('Picked Document Response', DocumentPickerResponse)

Steps to reproduce

Please run above mentioned code snippet and try to upload following files in a sequential manner then observe the picked response

  1. First try with this image file nature

This is the picked response

jpeg file
  1. Try with this .docx file example03.docx

This is the picked response

word file
  1. Try with .pdf file blank.pdf

This is the picked response

pdf file

Form above picked responses I have observed few following things

  1. Image file response contains two extra props called fileName and fileSize (Which I have outlined by drawing box in image response) which are not available in .docx and .pdf responses. (And I have observed that only image file contains those two extra props, Even i tried .ppt and .xlx as well).

  2. In image file response file name is same in fileCopyUri and name props which I have underlined. But in .docx response and .pdf response file name is different in fileCopyUri and name props.

3.fileCopyUri (OR uri) is looking different in image file response from .docx and .pdf file response. (which you can observe in attached responses).

Note: I have tired to upload all these files from Downloads folder only.

Environment info

react: 16.13.1 => 16.13.1 react-native: 0.63.2 => 0.63.2 react-native-document-picker: "5.0.3" Platform: Android -> Tried with Samsung, Motorola and Honor

I tired with multiple devices like Samsung(Android 12), Motorola(Android 8) and Honor(Android 9) and same thing is happening across all the devices

I have few doubts

1.Doses this package has any limitations with any particular type of file?

2.Is anything wrong with the library version or React-Native that I am using? .

vonovak commented 2 years ago

hello, we only accept bug reports for latest package version. I hope you understand and thank you. Feel free to open another issue with latest version of the library.

however, I'm almost certain this lib never included fileName and fileSize fields so your screenshots are likely not screenshots of results from this lib. Please note I will close issues that do not provide runnable reproduction. thank you

Yandamuri commented 2 years ago

@vonovak Thank you so much for your response. I will try with latest version and contact you if any help is needed.