# Actions

### <mark style="color:purple;">Refresh Drive List</mark>

Refresh drive list (if user has plugged/unplugged a device, this will update with the latest drive values)

***

### <mark style="color:purple;">Set Current Directory</mark>

Sets the current directory of the Filesystem element. Use this to go to a known directory path (ex. C:\Users\userName\Desktop)

***

### <mark style="color:purple;">Go To Next Directory</mark>

Takes current directory output and combines it with a name to navigate to the next directory (ex. **C:\Users** + ***userName*** = C:\Users\userName)

***

### <mark style="color:purple;">Go Back A Directory</mark>

Removes last directory from current directory (Ex. **C:\Users\userName** - ***userName*** = C:\Users)

***

### <mark style="color:purple;">Trim Path By Segements</mark>

Trims the current directory path by keeping only the first ***N*** segments.\
\
For example, an index value of 2 on the directory of "C:/Users/Example/Desktop" would trim the directory to "C:/Users" (2 segments)

***

### <mark style="color:purple;">Refresh Current Directory</mark>

Checks the current directory for updates.

***

### <mark style="color:purple;">Create Directory</mark>

Creates a new folder in the given directory.

***

### <mark style="color:purple;">Set File Uploader Value</mark>

Sets the value of a file uploader. Specify file paths & element ID

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Request Download</mark>

Accepts a file URL. Will prompt the user to choose where they want to save the download. Will fire the 'Download Started' event if started or the 'Download Canceled' if the dialog is closed.

***

### <mark style="color:purple;">Pause Download</mark>

Pause a download by Download ID.

{% hint style="warning" %}
Some paused downloads may not be able to be resumed, depending on the web server. In this case, the download will restart.
{% endhint %}

***

### <mark style="color:purple;">Resume Download</mark>

Resume a download by Download ID.

{% hint style="warning" %}
Some paused downloads may not be able to be resumed, depending on the web server. In this case, the download will restart.
{% endhint %}

***

### <mark style="color:purple;">Cancel Download</mark>

Cancel a download by Download ID.

***

### <mark style="color:purple;">Read File</mark>

Reads the contents of a file. This will populate the "File Contents" custom state. It will also fire the "File Read" event.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

{% hint style="danger" %}
This reads the full content of the file in memory before returning the data.

This means that big files are going to have a major impact on your memory consumption and can lead to crashes/hanging.\
\
Use this in tandem with the "File System - Get File Stats" action to make sure the file is small in size.
{% endhint %}

***

### <mark style="color:purple;">Create File</mark>

Creates an empty file for you to write data to at a given path.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Write File</mark>

Writes to a file. Note, this will overwrite a file's contents.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Rename File</mark>

Renames a file.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Get File Stats</mark>

Returns data such as created date, file size, etc. This will populate the "File Details" custom state. It will also fire the "File Stats Retrieved" event.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Trash File</mark>

Attempts to move the given file to the recycle bin.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}

***

### <mark style="color:purple;">Show In Folder</mark>

Opens the native file explorer, and shows the given path.

***

### <mark style="color:purple;">Generate Thumbnail</mark>

Returns a preview thumbnail for a media file such as an image or video. Outputs to the "Thumbnail" state as a base64 encoded string.

{% hint style="danger" %}
Limited to whitelisted directories, without custom code signing certificates.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://deskifier.gitbook.io/deskifier/deskifier-bubble.io-docs/filesystem-element/actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
