mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move to char+timestamp for img naming.
This commit is contained in:
@@ -2655,7 +2655,11 @@ app.post('/uploadimage', jsonParser, async (request, response) => {
|
||||
const [, format, base64Data] = match;
|
||||
|
||||
// Constructing filename and path
|
||||
const filename = `${Date.now()}.${format}`;
|
||||
let filename = `${Date.now()}.${format}`;
|
||||
if(request.body.filename){
|
||||
filename = `${request.body.filename}.${format}`;
|
||||
}
|
||||
|
||||
// if character is defined, save to a sub folder for that character
|
||||
let pathToNewFile = path.join(directories.userImages, filename);
|
||||
if(request.body.ch_name){
|
||||
|
Reference in New Issue
Block a user