Skip to content

Commit

Permalink
Added volume subpath for local files
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseydiloreto committed Feb 23, 2024
1 parent e11d647 commit 7d1328b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Fixed
- Added volume subpath for local files.

## 3.0.0-beta.1 - 2024-02-22

### Changed
Expand Down
4 changes: 3 additions & 1 deletion src/services/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ private function _outputFile(Link $link): void
// Get volume and folder paths
$fsSettings = $filesystem->getSettings();
$fsPath = App::parseEnv($fsSettings['path']).'/';
$volumePath = $volume->getSubpath();
$folderPath = $asset->getFolder()->path.'/';

// Set local path (prevent double slashes)
$filepath = preg_replace('#/+#', '/', $fsPath.$folderPath);
$filepath = "{$fsPath}/{$volumePath}/{$folderPath}/";
$filepath = preg_replace('#/+#', '/', $filepath);

// Set path for local file
$assetFilePath = $filepath.$asset->filename;
Expand Down

0 comments on commit 7d1328b

Please sign in to comment.