---
title: usbfilesystem
slug: develop/usbfilesystem
docTags: 
createdAt: 2025-03-27T16:59:00.434Z
---

The *usbfilesystem* object allows supported BrightSign players to expose a local file as a USB mass storage device when connected to a USB host port on another device (for example, a PC or television.) The host acts as if it is talking to a USB thumb drive or USB hard drive, but the reads and writes go to the specified local file on the BrightSign. Normally the local file would be prepared beforehand with a filesystem offline or using [filesysteminfile](docId\:kEg9ZrLJkkJK2dfHPjX65) on the player itself.

BrightSign players with USB-C (except for LS3 and LS4) can use this object.

**usbfilesystem IDL**

```javascript
interface UsbFilesystem {                                                                                                                                                                                                                                               
    constructor();                                                                                                                                                                                                                                                      
    Promise<void> enable(String filename);                                                                                                                                                                                                                              
    Promise<void> disable();                                                                                                                                                                                                                                            
};  
```

## Object Creation

To create a *usbfilesystem* object, load the *@brightsign/usbfilesystem* module using the require() method. 

```javascript
var FilesystemClass = require('@brightsign/usbfilesystem');
var usbfilesystem = new FilesystemClass();
```

## UsbFilesystem

**enable()**

```javascript
Promise<void> enable(String filename)
```

Exposes an existing filesystem image as a USB mass storage device.

- `filename` <font color="#6554c0">string</font>: The name of the file to expose as a USB mass storage device.

**disable()**

```javascript
Promise<void> disable()
```

Removes an existing filesystem image as a USB mass storage device.

## Example

```javascript
var FilesystemClass = require('@brightsign/usbfilesystem');
var usbfilesystem = new FilesystemClass();

// Additional Description: Using filesysteminfile will help build a .img file

// Mount an already built filesystem image
usbfilesystem.enable("/storage/sd/usbstore.img")
.then(function (result) {
  console.log("Successfully mounted!");
})
.catch(function(err) {
  console.log(JSON.stringify(err));
});

// Unmount a filesystem image
usbfilesystem.disable()
.then(function() {
  console.log("Successfully unmounted");
})
.catch(function(err) {
  console.log( JSON.stringify(err) );
});
```

