Skip to content

Commit

Permalink
avatarforapp
Browse files Browse the repository at this point in the history
  • Loading branch information
chatbookai committed Jun 2, 2024
1 parent 21a9a9b commit d2b5727
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion express/src/utils/llms.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,17 @@ let ChatBaiduWenxinModel = null
console.log("FileName Exist: ", FileName)
}
else {
res.status(200).json({ error: 'File not exist' })
const FileName = path.join('demo', "/avatarforapp/"+ file);
if(isFile(FileName)) {
compressPng(file);
const readStream = fs.createReadStream(FileName);
res.setHeader('Content-Type', 'image/png');
readStream.pipe(res);
console.log("FileName Exist: ", FileName)
}
else {
res.status(200).json({ error: 'File not exist' })
}
}
}
catch (error) {
Expand Down

0 comments on commit d2b5727

Please sign in to comment.