# How to upload to vectorStore from Buffer?

**URL:** https://community.openai.com/t/how-to-upload-to-vectorstore-from-buffer/1047366
**Category:** API
**Tags:** file-uploads, assistants-files, file-search
**Created:** [December 8, 2024, 3:31pm UTC](https://community.openai.com/t/how-to-upload-to-vectorstore-from-buffer/1047366 "2024-12-08T15:31:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ayla.who.codes](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ayla.who.codes/32/512906_2.png) [@ayla.who.codes](https://community.openai.com/u/ayla.who.codes)
#### Post date: [December 8, 2024, 3:31pm UTC](https://community.openai.com/t/how-to-upload-to-vectorstore-from-buffer/1047366/1 "2024-12-08T15:31:15Z")

</div>

I’m using the typescript node.js SDK and want to use an assistant with fileSearch. I hafe the file content in Butter:

```auto
import OpenAI from 'openai';
import { Readable } from 'stream';

const myFileBuffer = Buffer.from(JSON.stringify(myFileContent))
const readableStream = Readable.from(myFileBuffer);

```

How can I uploadAndPoll this data?

```auto
const vectorStore = await openai.beta.vectorStores.create({
      name: "Example Store",
    });

    const fileBatch = await openai.beta.vectorStores.fileBatches.uploadAndPoll(
        vectorStore.id,
        {
            files: readableStream
        }
    );

```

I get the error:

`Type 'ReadableBase' is missing the following properties from type 'Uploadable[]': length, pop, concat, join, and 25 more.ts(2740)`

Thanks!
