# ADMIN API Uploading File issue

**URL:** <https://forum.ghost.org/t/admin-api-uploading-file-issue/42873>\
**Category:** Integrations & API\
**Created:** [November 21, 2023, 12:02pm UTC](https://forum.ghost.org/t/admin-api-uploading-file-issue/42873 "2023-11-21T12:02:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anoop\_Netsparked](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/anoop_netsparked/32/26930_2.png) [@Anoop\_Netsparked](https://forum.ghost.org/u/Anoop_Netsparked)\
**Post date:** [November 21, 2023, 12:02pm UTC](https://forum.ghost.org/t/admin-api-uploading-file-issue/42873/1 "2023-11-21T12:02:23Z")

</div>

Hi,

I have created the admin API key and successfully created the new post. But I am now facing the problem of uploading any file. Not the Image it can be xls, pdf, csv. Please check below the code I used for creating a post. I had passed the file parameter but it is not working.

$headers = [  
'Authorization: Ghost ’ . $token,  
‘Content-Type: application/json’,  
‘Accept-Version: v3.0’,  
];  
$payload = json\_encode([‘posts’ =\> [[‘title’ =\> ‘Hello sgdfg’, ‘html’ =\> ‘

My post content. Work in progress…

’]]]);

Any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![ngeorger](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ngeorger/32/24496_2.png) [@ngeorger](https://forum.ghost.org/u/ngeorger)\
**Post date:** [January 3, 2024, 12:23am UTC](https://forum.ghost.org/t/admin-api-uploading-file-issue/42873/2 "2024-01-03T00:23:56Z")

</div>

What is the returned error message?

---

<div class="post-metadata">

**Author:** ![Anoop\_Netsparked](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/anoop_netsparked/32/26930_2.png) [@Anoop\_Netsparked](https://forum.ghost.org/u/Anoop_Netsparked)\
**Post date:** [February 27, 2024, 5:05pm UTC](https://forum.ghost.org/t/admin-api-uploading-file-issue/42873/3 "2024-02-27T17:05:47Z")

</div>

I fixed it @ngeorger

---

<div class="post-metadata">

**Author:** ![PAK](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/pak/32/35175_2.png) [@PAK](https://forum.ghost.org/u/PAK)\
**Post date:** [March 5, 2025, 6:17pm UTC](https://forum.ghost.org/t/admin-api-uploading-file-issue/42873/4 "2025-03-05T18:17:07Z")

</div>

How did you fix it ?
