browFiles
List files and folders at a specified path in the media directory.
Import
import { browFiles } from "@evershop/evershop/cms/services";
Syntax
browFiles(path: string): Promise<{ files: FileBrowser[]; folders: string[] }>
Parameters
path
Type: string
Relative path within media directory.
Return Value
Returns Promise with:
{
files: FileBrowser[]; // Array of file objects
folders: string[]; // Array of folder names
}
FileBrowser object:
{
name: string; // File name
url: string; // File URL
}
See Also
- createFolder - Create folder
- uploadFile - Upload files
- deleteFile - Delete files