Replace path "\" with "/" server-side

This commit is contained in:
valadaptive
2023-12-05 17:55:52 -05:00
parent 795ca2247b
commit 39d771cc4a
5 changed files with 7 additions and 6 deletions

View File

@@ -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);

View File

@@ -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');