-
Notifications
You must be signed in to change notification settings - Fork 76
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
validateFileName problem? #54
Comments
Sorry for the delayed response. The error you're getting is due to an entry is the zipfile having backslash characters in its filename. If you think the filenames don't have backslashes, then perhaps you're examining the zipfile with a tool that is transforming the backslashes into forward slashes before showing them to you. Here's some background information: The zip file specification forbids backslash characters in entry filenames. Although windows paths are typically and canonically represented with backslash separators, zip files are not specific to windows and must use forward slashes in entry file names. For reference, backslash characters are legitimately allowed in Linux file names (not as separators, but actually in the name of a file). The zip file specification probably forbids backslash characters in filenames because of the confusion that would arise from zipping a Linux file called However, it may be desirable to ignore this particular type of error. There's already a feature in yauzl that can accomplishing this, which is the Again, sorry for the delayed response. |
hi ,respect for @thejoshwolfe
just now, i got a problem, when i use zipfile.readEntry, it got a " invalid characters in fileName" ,so I trace code, find blow code
in index.js
but "fileName" are Common formats and have no error like "path\to\file.extension" ,
so i add a single line of code " fileName=fileName.replace(/\/g,'/') " at function's start ,and it's ok .
env:
OS: windows 10 ,×64
software: nodejs in nw.js
my question is why " invalid characters in fileName" come out ?
you got my respect, and thank you will be resolving my question.
The text was updated successfully, but these errors were encountered: