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

# String: Parse file path into parts

> Parses a file path into its components (directory, filename, and extension).

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Breaks a full file path apart into its separate pieces and returns them together as a small set of named values: the folder (`dirname`), the full filename (`basename`), the filename without its extension (`filename`), and the extension on its own (`extension`). Use this when you need more than one part of a path at once, for example to keep the folder and the extension but rename the file. The `extension` part is only included when the file actually has one.

This documentation describes: [Schema](/schemas/mapper/string-file-pathinfo)

## Fields

This mapper has no settings to configure. It always parses the path you give it into its parts.

## Sample data

| Field         | Value |
| ------------- | ----- |
| (no settings) |       |

Input:

```json theme={null}
{ "path": "/uploads/products/scarf-blue.jpg" }
```

Output:

```json theme={null}
{
    "path": {
        "dirname": "/uploads/products",
        "basename": "scarf-blue.jpg",
        "extension": "jpg",
        "filename": "scarf-blue"
    }
}
```

```json Configuration theme={null}
{
  "prototype": "string-file-pathinfo",
  "parameters": {}
}
```
