maybe buffer?
This commit is contained in:
parent
91df15209a
commit
41d696c6ca
1 changed files with 2 additions and 4 deletions
|
@ -82,8 +82,7 @@ mastoFileRouter.post("/v1/media", upload.single("file"), async (ctx) => {
|
||||||
ctx.status = 401;
|
ctx.status = 401;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const image = fs.readFileSync((multipartData).path);
|
const data = await client.uploadMedia(multipartData.buffer);
|
||||||
const data = await client.uploadMedia(image);
|
|
||||||
ctx.body = data.data;
|
ctx.body = data.data;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@ -102,8 +101,7 @@ mastoFileRouter.post("/v2/media", upload.single("file"), async (ctx) => {
|
||||||
ctx.status = 401;
|
ctx.status = 401;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const image = fs.readFileSync((multipartData).path);
|
const data = await client.uploadMedia(multipartData.buffer);
|
||||||
const data = await client.uploadMedia(image);
|
|
||||||
ctx.body = data.data;
|
ctx.body = data.data;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Reference in a new issue