mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Replace path "\" with "/" server-side
This commit is contained in:
@@ -167,7 +167,7 @@ export async function uploadFileAttachment(fileName, base64Data) {
|
||||
}
|
||||
|
||||
const responseData = await result.json();
|
||||
return responseData.path.replace(/\\/g, '/');
|
||||
return responseData.path;
|
||||
} catch (error) {
|
||||
toastr.error(String(error), 'Could not upload file');
|
||||
console.error('Could not upload file', error);
|
||||
|
@@ -950,7 +950,7 @@ export async function saveBase64AsFile(base64Data, characterName, filename = '',
|
||||
// If the response is successful, get the saved image path from the server's response
|
||||
if (response.ok) {
|
||||
const responseData = await response.json();
|
||||
return responseData.path.replace(/\\/g, '/'); // Replace backslashes with forward slashes
|
||||
return responseData.path;
|
||||
} else {
|
||||
const errorData = await response.json();
|
||||
throw new Error(errorData.error || 'Failed to upload the image to the server');
|
||||
|
Reference in New Issue
Block a user