question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure to open local file in windows platform

See original GitHub issue

Configuration:

  • Web browser and its version: Electron 1.7.8 ( use webpack and set target: 'electron-renderer')
  • Operating system and its version: Windows 10
  • PDF.js version: pdfjs-dist: 1.9.640
  • Is an extension: no

Steps to reproduce the problem:

  1. try to open C:/User/1234/Desktop/a.pdf
  2. window.location transform it to file:///C:/User/1234/Desktop/a.pdf
  3. PDFNodeStreamFsFullReader get /C:/User/1234/Desktop/a.pdf
  4. ENOENT: no such file or directory, lstat C:\C:\User\1234\Desktop\a.pdf

What went wrong?

the pr https://github.com/mozilla/pdf.js/pull/8928 is not working

path before decodeURI: /C:/User/1234/Desktop/a.pdf. Howerver, after decodeURI, path is still the same.

see also https://github.com/mozilla/pdf.js/issues/8946

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
juncaixinchicommented, Mar 21, 2018

@matteodem It’s not possible to use the fetch api to load local files via file protocol. However, the pdf.js supports reading local files if you are in NodeJS environment.

0reactions
matteodemcommented, Mar 20, 2018

@juncaixinchi …so this means this is not possible? as in the original issue is unresolved / unresolvable?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Access Denied" or other errors when you access or work ...
Issue 1: You receive an "Access Denied" error message or a similar message. Issue 2: You cannot access, change, save, or delete files...
Read more >
Miscellaneous Box Drive Error Notifications
To find a list of any problem file notifications: Click the Box icon in your menu bar or system tray to open the...
Read more >
[Solved] Access Denied When Copying Files Windows 10/8/7
Solution 2: Change File and Folder Permission (Give Full Control). This error may be related to permission. Permissions determine whether you ...
Read more >
Fix problems in Drive for desktop - Computer
Fix error messages · You aren't connected to the internet. You don't have any available drive letters (Windows only). Your proxy settings don't...
Read more >
Workable Fixes to Can't Read from Source File or Disk Error
If you can't read from the source file or disk Windows 10 and this is disturbing the normal functioning of your PC, have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found