Skip to content

folder structure

1 post with the tag "folder structure"

How the Blober file_dir Path Template Variable Really Works

How the file_dir path template variable preserves relative folders in Blober

{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 path

This distinction determines whether a custom path template preserves nested source structure.

In a workflow:

  1. Open Source Configuration.
  2. Click Browse Files and Folders.
  3. Select a folder and submit the selection.
  4. Complete Destination Configuration.
  5. Expand Advanced Path Template (Optional).
  6. 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.pdf

Because 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.pdf

Blober does not produce:

Clients/Acme/Final/report.pdf

The 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-2026

File:

Shoots/Wedding-2026/cover.jpg

The 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.jpg

The 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:

Shoots

Nested file:

Shoots/Wedding-2026/Camera-A/RAW/DSC_4821.ARW

Now the directory between the selected folder and the file is:

Wedding-2026/Camera-A/RAW

Therefore:

{file_dir} = Wedding-2026/Camera-A/RAW

and:

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.

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 itselfempty
Archive/2026/Client-A/Finalempty
Archive/2026/Client-AFinal
Archive/2026Client-A/Final
Archive2026/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: Projects
File: Projects/Acme/Final/report.pdf

the result becomes:

by-date/2026-07-18/Acme/Final/report.pdf

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}.

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}

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.

Use a small test tree containing:

Test/
root.txt
Level-1/
nested.txt
Level-2/
deep.txt

Select Test and preview {file_dir}/{filename}. Expected relative results:

root.txt
Level-1/nested.txt
Level-1/Level-2/deep.txt

That 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.