# Discourse API を使用して画像をアップロードする方法

**URL:** <https://meta.discourse.org/t/how-to-upload-image-using-discourse-api/148869>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [2020 年 4 月 22 日午後 3:23 UTC](https://meta.discourse.org/t/how-to-upload-image-using-discourse-api/148869 "2020-04-22T15:23:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![CormacW43](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@CormacW43](https://meta.discourse.org/u/CormacW43)\
**Post date:** [2024 年 8 月 28 日午前 11:47 UTC](https://meta.discourse.org/t/how-to-upload-image-using-discourse-api/148869/6 "2024-08-28T11:47:26Z")

</div>

これはまだ機能していないようです。

バイナリで画像をアップロードしようとすると、このエラーが表示されます。

```plaintext
Unprocessable Entity - {"failed":"FAILED","message":"undefined method `tempfile' for an instance of String"}

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-upload-image-using-discourse-api/148869)._
