# Upload media via API

**URL:** <https://forum.shopware.com/t/upload-media-via-api/87685>\
**Category:** Shopware 6 (English)\
**Created:** [15. Mai 2021 um 16:00 UTC](https://forum.shopware.com/t/upload-media-via-api/87685 "2021-05-15T16:00:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![uwekock](https://avatars.discourse-cdn.com/v4/letter/u/8c91f0/32.png) [@uwekock](https://forum.shopware.com/u/uwekock)\
**Post date:** [15. Mai 2021 um 16:00 UTC](https://forum.shopware.com/t/upload-media-via-api/87685/1 "2021-05-15T16:00:45Z")

</div>

Hi,

i try to upload an image via api call.

1. Create a media object in shopware in the right mediafolder

works fine!

1. Upload the new image (testfile.png) via url

a file is created, but the content of the file is not the png image but the payload string.

any Ideas?

---

<div class="post-metadata">

**Author:** ![trade](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@trade](https://forum.shopware.com/u/trade)\
**Post date:** [15. Mai 2021 um 18:19 UTC](https://forum.shopware.com/t/upload-media-via-api/87685/2 "2021-05-15T18:19:11Z")

</div>

Where is your image file located? Upload with url is not possible from a remote host, as far as I know. It has to be on the same server.

---

<div class="post-metadata">

**Author:** ![uwekock](https://avatars.discourse-cdn.com/v4/letter/u/8c91f0/32.png) [@uwekock](https://forum.shopware.com/u/uwekock)\
**Post date:** [15. Mai 2021 um 19:41 UTC](https://forum.shopware.com/t/upload-media-via-api/87685/3 "2021-05-15T19:41:55Z")

</div>

The image is located on an other public internet Server, uploading the same image in the shopware backend works fine.

just tested: image url on the same server also doesn’t work

---

<div class="post-metadata">

**Author:** ![trade](https://avatars.discourse-cdn.com/v4/letter/t/5fc32e/32.png) [@trade](https://forum.shopware.com/u/trade)\
**Post date:** [16. Mai 2021 um 08:03 UTC](https://forum.shopware.com/t/upload-media-via-api/87685/4 "2021-05-16T08:03:43Z")

</div>

I‘m sending not the url but the data of the image. First create the media object as you did and then uploading data. There are a few threads about this here in the german forum.
