Downloading Files Using Absolute File Paths in Universal Email
In universal email I'm only able to trigger the download if the path is ../../MyRepository
For security I would like to use the directory path outside the web root.
For Example use: /Volumes/A4/MyRespository
Here is an example of what works:
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(($_SESSION['DBbkup'] != "")){
$downloadname = $_SESSION['DBbkup'];
$dataroot = "../../MyRespository/";
$bkdir = $dataroot . 'backup/';
WA_DFP_DownloadFile("WA_DownloadResult1", "$bkdir", "$downloadname", "[FileName]", false, false, false, "", "", "", "");
}
?>
Here is an example of what doesn't work:
**A note for troubleshooting: I can upload using the path $dataroot and $bkdir below**
I believe the helper file is stripping something, but not sure what or how to correct its behavior.
<?php
WA_DFP_SetupDownloadStatusStruct("WA_DownloadResult1");
if(($_SESSION['DBbkup'] != "")){
$downloadname = $_SESSION['DBbkup'];
$dataroot = "/Volumes/A4/MyRespository/";
$bkdir = $dataroot . 'backup/';
WA_DFP_DownloadFile("WA_DownloadResult1", "$bkdir", "$downloadname", "[FileName]", false, false, false, "", "", "", "");
}
?>
Thank you.