New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Cannot load PDF if HTTP Content-Disposition Header is set - File not in PDF format or corrupted #253

Closed
EyMaddis opened this Issue Oct 9, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@EyMaddis

EyMaddis commented Oct 9, 2018

What react-native version are you using ?
0.56.0

What react-native-pdf version are you using ?
5.0.6

What platform does your issue occur on?
Android only - works on iOS

Describe your issue as precisely as possible :

  1. Use PDF Viewer to load external URL
  2. Set header for file as: content-disposition: attachment; filename="filename.pdf"
<PDFView
    source={{
        uri: EXTERNAL_LINK
        cache: false // no difference
    }}
    style={Styles.flex}
    onLoadComplete={console.log.bind(console, 'loading finished')}
    onError={console.error.bind(console, 'loading error!')}
/>

Will throw File not in PDF format or corrupted'. Removing the header works.

@EyMaddis

This comment has been minimized.

Show comment
Hide comment
@EyMaddis

EyMaddis Oct 9, 2018

This was actually not related to the header, I was accidentally not checking the correct js state of the app.

EyMaddis commented Oct 9, 2018

This was actually not related to the header, I was accidentally not checking the correct js state of the app.

@EyMaddis EyMaddis closed this Oct 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment