mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-01 05:29:41 +00:00
feat: Support Uploading files to existing library item folders
Adds support to uploads as specified in enhancement #1894
This commit is contained in:
parent
b01facc034
commit
397613795f
2 changed files with 27 additions and 20 deletions
|
|
@ -88,7 +88,7 @@ class FileSystemController {
|
|||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
const { directory, folderPath } = req.body
|
||||
const { folderPath, directory, fileName } = req.body
|
||||
if (!directory?.length || typeof directory !== 'string' || !folderPath?.length || typeof folderPath !== 'string') {
|
||||
Logger.error(`[FileSystemController] Invalid request body: ${JSON.stringify(req.body)}`)
|
||||
return res.status(400).json({
|
||||
|
|
@ -113,7 +113,7 @@ class FileSystemController {
|
|||
return res.sendStatus(403)
|
||||
}
|
||||
|
||||
let filepath = Path.join(libraryFolder.path, directory)
|
||||
let filepath = Path.join(libraryFolder.path, directory, fileName)
|
||||
filepath = fileUtils.filePathToPOSIX(filepath)
|
||||
|
||||
// Ensure filepath is inside library folder (prevents directory traversal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue