# Can't upload files with my bot

**URL:** <https://forums.rocket.chat/t/cant-upload-files-with-my-bot/8556>\
**Category:** Development\
**Tags:** rocketchat-apps\
**Created:** [September 15, 2020, 9:38pm UTC](https://forums.rocket.chat/t/cant-upload-files-with-my-bot/8556 "2020-09-15T21:38:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ozdavid](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/ozdavid/32/2166_2.png) [@ozdavid](https://forums.rocket.chat/u/ozdavid)\
**Post date:** [September 15, 2020, 9:38pm UTC](https://forums.rocket.chat/t/cant-upload-files-with-my-bot/8556/1 "2020-09-15T21:38:04Z")

</div>

Hey there, I’m using rocketchat sdk in my nodejs project.  
I’m trying to upload a file through my bot into a room with no success.  
I see a very long log, which seems to be good after sending the message, but it doesn’t upload it.  
Here is my code:

```auto
const uploadImage = async (path:string, rid:string) =>{
   const formData = new FormData();
   const stream = fs. createStream(path);
   formData.append('file', stream);
   await api.post(`rooms.upload/${rid}`, formData, true);
}
```
