diff --git a/packages/megalodon/src/misskey.ts b/packages/megalodon/src/misskey.ts index 97b17a0d61..39665572c9 100644 --- a/packages/megalodon/src/misskey.ts +++ b/packages/megalodon/src/misskey.ts @@ -1646,17 +1646,14 @@ export default class Misskey implements MegalodonInterface { public async uploadMedia(file: any, options?: { description?: string; focus?: string }): Promise> { const formData = new FormData() formData.append('file', fs.createReadStream(file.path), { - contentType: file.mimetype, - filename: file.originalname + contentType: file.mimetype }) - if (file.originalname != null) { + if (file.originalname != null && file.originalname !== 'file') formData.append('name', file.originalname); - } - if (options?.description != null) { + if (options?.description != null) formData.append('comment', options.description); - } let headers: { [key: string]: string } = {} if (typeof formData.getHeaders === 'function') {