mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-07 23:58:42 +01:00
Move background file instead of copying+deleting
This commit is contained in:
parent
e7dce9b107
commit
c0a7472fe9
@ -76,10 +76,9 @@ router.post('/upload', urlencodedParser, function (request, response) {
|
||||
const filename = request.file.originalname;
|
||||
|
||||
try {
|
||||
fs.copyFileSync(img_path, path.join('public/backgrounds/', filename));
|
||||
fs.renameSync(img_path, path.join('public/backgrounds/', filename));
|
||||
invalidateThumbnail('bg', filename);
|
||||
response.send(filename);
|
||||
fs.unlinkSync(img_path);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
response.sendStatus(500);
|
||||
|
Loading…
x
Reference in New Issue
Block a user