> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# upload

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

[Source: node-sdk/src/files.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/files.ts)

Upload a file to the session. A string is read as a local path and its
basename becomes the uploaded filename unless `uploadFileName` is set.

```typescript theme={null}
RemoteFileStorage.upload(file: UploadableFile, uploadFileName?: string): Promise<SessionFile>;
```

## Parameters

<ParamField body="file" type={"UploadableFile"} required>
  Local file path, Blob, File, or buffer to upload.
</ParamField>

<ParamField body="uploadFileName" type={"string"}>
  Optional stored filename. Local paths default to their basename; File objects keep their name.
</ParamField>

## Returns

```typescript theme={null}
Promise<SessionFile>
```

Metadata for the uploaded file, including its ID, name, and size.

## Raises

* NotteAPIError if the storage API request fails.
* InvalidRequestError if storage has not been bound to a session.
* InvalidRequestError if a supplied local path is not a file.

## Example

```typescript theme={null}
await storage.upload('./data/resume.pdf');
await storage.upload(Buffer.from('hello'), 'hello.txt');
```

## Related types

* [SessionFile](/typescript-sdk-reference/types/sessionfile)
* [UploadableFile](/typescript-sdk-reference/types/uploadablefile)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.