function ewUploadPathEx($PhyPath, $DestPath) { global $ewPathDelimiter; if ($PhyPath) { $Path = ewAppRoot(); $Path .= str_replace("/", $ewPathDelimiter, $DestPath); } else { $Path = EW_RootRelativePath; $Path = str_replace("\\\\", "/", $Path); $Path = str_replace("\\", "/", $Path); $Path = ewIncludeTrailingDelimiter($Path, false) . $DestPath; } return ewIncludeTrailingDelimiter($Path, $PhyPath); }
function ewAppRoot() { global $ewPathDelimiter; // 1. use root relative path (4.0.2) if (EW_RootRelativePath != "") { $Path = realpath(EW_RootRelativePath); $Path = str_replace("\\\\", $ewPathDelimiter, $Path); } // 2. if empty, use the document root if available if (empty($Path)) { $Path = @$_SERVER["DOCUMENT_ROOT"]; } if (empty($Path)) { $Path = @$_ENV["DOCUMENT_ROOT"]; } // 3. if empty, use current folder if (empty($Path)) { $Path = realpath("."); } // 4. use custom path, uncomment the following line and enter your path // e.g. $Path = "C:\Inetpub\wwwroot\MyWebRoot"; // Windows //$Path = "enter your path here"; if (empty($Path)) { die("Path of website root unknown."); } return ewIncludeTrailingDelimiter($Path, true); }