mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 17:03:49 +01:00
[mastodon-client] drive file name fixup
This commit is contained in:
parent
994f08d735
commit
8180f4d494
@ -1646,17 +1646,14 @@ export default class Misskey implements MegalodonInterface {
|
||||
public async uploadMedia(file: any, options?: { description?: string; focus?: string }): Promise<Response<Entity.Attachment>> {
|
||||
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') {
|
||||
|
Loading…
Reference in New Issue
Block a user