Ticket #89 (closed defect: fixed)
Files Action - Windows Paths Issue
| Reported by: | dartar | Owned by: | BrianKoontz |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3.1 |
| Component: | actions | Version: | 1.1.6.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by DarTar) (diff)
(reported by QualousHere) On a Windows/IIS installation, including the {{files}} action causes errors similar to the following:
Warning: mkdir(uploads\SandBox): Permission denied in D:\sitepath\wwwroot\wikka\actions\files.php on line 12 Warning: opendir(uploads\SandBox): failed to open dir: Invalid argument in D:\sitepath\wwwroot\wikka\actions\files.php on line 156 Warning: readdir(): supplied argument is not a valid Directory resource in D:\sitepath\wwwroot\wikka\actions\files.php on line 157 Warning: closedir(): supplied argument is not a valid Directory resource in D:\sitepath\wwwroot\wikka\actions\files.php on line 200
This is caused by the assumption of "/" as the directory seperator instead of Window's "\". Using the DIRECTORY_SEPARATOR variable corrects this issue. In actions/files.php change:
$upload_path = $this->config['upload_path'].'/'.$this->GetPageTag();
into
$upload_path = $this->config['upload_path'].DIRECTORY_SEPARATOR.$this->GetPageTag();
and also:
$destfile = $upload_path.'/'.$strippedname;
into
$destfile = $upload_path.DIRECTORY_SEPARATOR.$strippedname;
Warning: This has only been tested so far under Windows.
Related tickets
Change History
Note: See
TracTickets for help on using
tickets.