-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
feat: custom file (re)naming, sanitizing - use the new options.filename
#591
Conversation
If `options.filename` is passed and is function, it is passed with `part`. Must return full absolute filepath for the file. Still works with `options.keepExtensions`. By default we rename the files to random id (joined to the uploadDir), generated from `hexoid` package. Signed-off-by: Charlike Mike Reagent <[email protected]>
Thank you for raising your pull request. Please make sure again that you have followed our contributing guidelines and the code of conduct. We will review it as soon as possible. |
Codecov Report
@@ Coverage Diff @@
## master #591 +/- ##
==========================================
- Coverage 83.98% 83.93% -0.06%
==========================================
Files 14 14
Lines 637 635 -2
Branches 103 104 +1
==========================================
- Hits 535 533 -2
+ Misses 94 93 -1
- Partials 8 9 +1
Continue to review full report at Codecov.
|
Signed-off-by: Charlike Mike Reagent <[email protected]>
options.filename
options.filename
Signed-off-by: Charlike Mike Reagent <[email protected]>
anyway, realized what it was and fixed it. |
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
Signed-off-by: Charlike Mike Reagent <[email protected]>
* fix: make opts.filename from #591 work with opts.keepExtensions * chore: tweaks for failing tests * fix: extension problems Signed-off-by: Charlike Mike Reagent <[email protected]>
If
options.filename
is passed and is function, it is passed withpart
.Must return full absolute filepath for the file.
Still works with
options.keepExtensions
.By default we rename the files to random id (joined to the uploadDir), generated from
hexoid
package.options.filename: (part, $self) => path.join($self.uploadDir, part.filename)
options.filename: (part) => path.join(UPLOAD_DIR, part.filename)
options.filename: function rename(part) { return path.join(this.uploadDir, part.filename }
$self
is the form, or just pass the same asoptions.uploadDir
options.uploadDir
by default isos.tmpdir()