fix(basic.gbapp): AS IMAGE testing.
This commit is contained in:
parent
d48cb03c32
commit
78837ac001
1 changed files with 2 additions and 1 deletions
|
@ -1224,13 +1224,14 @@ export class DialogKeywords {
|
||||||
|
|
||||||
const imageData = await (await fetch(url)).arrayBuffer();
|
const imageData = await (await fetch(url)).arrayBuffer();
|
||||||
const contentType = mime.lookup(url);
|
const contentType = mime.lookup(url);
|
||||||
|
const ext = mime.extension(url);
|
||||||
reply['attachments'] = [];
|
reply['attachments'] = [];
|
||||||
|
|
||||||
// Prepare a cache to be referenced by Bot Framework.
|
// Prepare a cache to be referenced by Bot Framework.
|
||||||
|
|
||||||
let buf: any = Buffer.from(imageData);
|
let buf: any = Buffer.from(imageData);
|
||||||
const gbaiName = DialogKeywords.getGBAIPath(min.botId);
|
const gbaiName = DialogKeywords.getGBAIPath(min.botId);
|
||||||
const localName = Path.join('work', gbaiName, 'cache', `tmp${GBAdminService.getRndReadableIdentifier()}.docx`);
|
const localName = Path.join('work', gbaiName, 'cache', `tmp${GBAdminService.getRndReadableIdentifier()}.${ext}`);
|
||||||
Fs.writeFileSync(localName, buf, { encoding: null });
|
Fs.writeFileSync(localName, buf, { encoding: null });
|
||||||
url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', Path.basename(localName));
|
url = urlJoin(GBServer.globals.publicAddress, min.botId, 'cache', Path.basename(localName));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue