How the Blober file_dir Path Template Variable Really Works
The Short Definition
Section titled "The Short Definition"{file_dir} is the directory path relative to the folder you selected as the source boundary. It is the part of the path that sits below that folder, not the file's full path and not always its immediate parent folder.
Blober works it out as it scans the files inside a folder you selected:
file_dir = directory containing the file - selected folder pathThis distinction determines whether a custom path template preserves nested source structure.
Where You Use It
Section titled "Where You Use It"In a workflow:
- Open Source Configuration.
- Click Browse Files and Folders.
- Select a folder and submit the selection.
- Complete Destination Configuration.
- Expand Advanced Path Template (Optional).
- Add
{file_dir}to the Template Pattern.
A common preservation template is:
{file_dir}/{filename}This produces a clean filename when {file_dir} is empty and adds nested directories when it is not. Blober removes the empty path segment rather than creating a leading slash.
Case 1: You Select an Individual File
Section titled "Case 1: You Select an Individual File"Selected item:
Clients/Acme/Final/report.pdfBecause you picked the file itself, Blober has no selected folder to measure it against. Its relative directory is null, which becomes an empty {file_dir} value.
Template: {file_dir}/{filename}Result: report.pdfBlober does not produce:
Clients/Acme/Final/report.pdfThe original parent path is not automatically inferred into {file_dir} for a directly selected file.
This matters when several individual files are selected from different folders. A {file_dir}/{filename} template will not recreate each file's original parent folder. If retaining those parent folders matters, select their containing folders instead.
Case 2: You Select a Folder and the File Is at Its Root
Section titled "Case 2: You Select a Folder and the File Is at Its Root"Selected folder:
Shoots/Wedding-2026File:
Shoots/Wedding-2026/cover.jpgThe file's containing directory and the selected folder are the same. The relative path between them is empty.
{file_dir} = ""Template: {file_dir}/{filename}Result: cover.jpgThe selected folder name Wedding-2026 is not included in {file_dir}. The selected folder is the boundary, so relative calculation starts inside it.
If you want the selected folder name in the destination, add it as static text:
Wedding-2026/{file_dir}/{filename}or select the parent folder Shoots, which changes the relative boundary.
Case 3: You Select a Folder and the File Is Nested
Section titled "Case 3: You Select a Folder and the File Is Nested"Selected folder:
ShootsNested file:
Shoots/Wedding-2026/Camera-A/RAW/DSC_4821.ARWNow the directory between the selected folder and the file is:
Wedding-2026/Camera-A/RAWTherefore:
{file_dir} = Wedding-2026/Camera-A/RAWand:
Template: originals/{file_dir}/{filename}Result: originals/Wedding-2026/Camera-A/RAW/DSC_4821.ARW{file_dir} can contain several levels. It holds the full relative path between the selected folder and the file, not only the single parent folder directly above it.
Selection Changes the Result
Section titled "Selection Changes the Result"The same physical file can receive different {file_dir} values depending on the source selection.
File:
Archive/2026/Client-A/Final/video.mp4| Selected source | {file_dir} |
|---|---|
| The file itself | empty |
Archive/2026/Client-A/Final | empty |
Archive/2026/Client-A | Final |
Archive/2026 | Client-A/Final |
Archive | 2026/Client-A/Final |
This is intentional. Selection defines the root that should not be repeated at the destination.
Why file_dir Matters With Custom Templates
Section titled "Why file_dir Matters With Custom Templates"Without a custom template, Blober can automatically preserve subdirectories when Include Subdirectories is enabled.
Once a custom template is entered, that automatic path is replaced. Consider:
by-date/{file_created_date}/{filename}Every qualifying file is grouped by date. Existing source subfolders disappear from the destination path.
To organize by date while retaining relative folders:
by-date/{file_created_date}/{file_dir}/{filename}For:
Selected folder: ProjectsFile: Projects/Acme/Final/report.pdfthe result becomes:
by-date/2026-07-18/Acme/Final/report.pdfMixed File and Folder Selections
Section titled "Mixed File and Folder Selections"Blober allows multiple source selections. You can select one folder and several individual files.
Their {file_dir} values do not behave identically:
- Files discovered inside the folder receive a relative path beneath that folder.
- Files directly selected receive an empty value.
- Files at the selected folder's root also receive an empty value.
If the destination must retain a meaningful folder for every file, avoid mixing individual-file selection with a template that depends entirely on {file_dir}. Select common parent folders or add another stable prefix such as {file_ext} or {file_created_date}.
Useful Templates
Section titled "Useful Templates"Preserve the relative hierarchy:
{file_dir}/{filename}Add an archive prefix:
archive/{file_dir}/{filename}Split by type while preserving hierarchy:
{file_ext}/{file_dir}/{filename}Group by creation date while preserving hierarchy:
{file_created_date}/{file_dir}/{filename}Rename while preserving hierarchy:
{file_dir}/{file_created_datetime}_{filename}Common Mistakes
Section titled "Common Mistakes"Expecting the selected folder's name to appear. It will not. {file_dir} starts below the selected folder.
Selecting individual files and expecting parent folders. Directly selected files have no relative selected-folder context, so {file_dir} is empty.
Assuming Include Subdirectories adds folders to a custom template. A custom path expression takes precedence. Add {file_dir} explicitly.
Using {file_dir} without {filename}. The variable describes directories, not the final filename. A template normally needs both.
Verify It in Preview
Section titled "Verify It in Preview"Use a small test tree containing:
Test/ root.txt Level-1/ nested.txt Level-2/ deep.txtSelect Test and preview {file_dir}/{filename}. Expected relative results:
root.txtLevel-1/nested.txtLevel-1/Level-2/deep.txtThat one preview demonstrates the complete rule before it is applied to a large archive.
Continue with the complete Blober path-template guide or learn how selection and glob filters define which files reach the template.