# How to post pictures via API?

**URL:** <https://meta.discourse.org/t/how-to-post-pictures-via-api/314282>\
**Category:** Development\
**Created:** [June 29, 2024, 6:49am UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282 "2024-06-29T06:49:34Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [July 3, 2024, 6:35am UTC](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282/8 "2024-07-03T06:35:22Z")

</div>

I’m guessing a bit here, but I don’t think configuring CORS will work for this case. The origin (at least from the Obsidian Desktop app) is `'app://obsidian.md'`. I _think_ CORS can only be configured on Discourse to deal with HTTP requests.

@maxtim, do you need this to work from mobile, or would just being able to post to Discourse from the desktop app be good enough? I’m again guessing a bit, but… my understanding is that the desktop app is an Electron app. It’s running on a combination of Chromium and Node.js. You might be able to use [`node-fetch`](https://www.npmjs.com/package/node-fetch) to make server-side requests to Discourse. If that works, it would take care of the CORS issue and let you use FormData in requests.

---

_[View the full topic](https://meta.discourse.org/t/how-to-post-pictures-via-api/314282)._
