mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
fix: pptx encoding (#3905)
This commit is contained in:
@@ -45,10 +45,12 @@ const parsePowerPoint = async ({
|
||||
|
||||
// Returning an array of all the xml contents read using fs.readFileSync
|
||||
const xmlContentArray = await Promise.all(
|
||||
files.map((file) => {
|
||||
return fs.promises.readFile(`${decompressPath}/${file.path}`, encoding).catch(() => {
|
||||
return fs.promises.readFile(`${decompressPath}/${file.path}`, 'utf-8');
|
||||
});
|
||||
files.map(async (file) => {
|
||||
try {
|
||||
return await fs.promises.readFile(`${decompressPath}/${file.path}`, encoding);
|
||||
} catch (err) {
|
||||
return await fs.promises.readFile(`${decompressPath}/${file.path}`, 'utf-8');
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user