Extracts the directory portion from a file path. For example, ‘/uploads/image.jpg’ returns ‘/uploads’.
Takes a full file path and keeps only the folder part, dropping the filename at the end. Use this when a field holds a complete path but you only need to know which folder the file lives in, for example to group files by their location or to rebuild a path with a different filename.