diff --git a/airtime_mvc/application/common/HTTPHelper.php b/airtime_mvc/application/common/HTTPHelper.php index 505befd7e..2b6b24cee 100644 --- a/airtime_mvc/application/common/HTTPHelper.php +++ b/airtime_mvc/application/common/HTTPHelper.php @@ -31,6 +31,9 @@ class Application_Common_HTTPHelper if (empty($baseDir)) { $baseDir = "/"; } + if ($baseDir[0] != "") { + $baseDir = "/" . $baseDir; + } $stationUrl = "$scheme://${baseUrl}:${basePort}${baseDir}"; return $stationUrl; diff --git a/airtime_mvc/application/models/airtime/CcFiles.php b/airtime_mvc/application/models/airtime/CcFiles.php index 0d59e576a..079b47556 100644 --- a/airtime_mvc/application/models/airtime/CcFiles.php +++ b/airtime_mvc/application/models/airtime/CcFiles.php @@ -160,7 +160,7 @@ class CcFiles extends BaseCcFiles { throw new Exception("Bad file extension."); } - $callbackUrl = Application_Common_HTTPHelper::getStationUrl() . "rest/media/" . $file->getPrimaryKey(); + $callbackUrl = Application_Common_HTTPHelper::getStationUrl() . "/rest/media/" . $file->getPrimaryKey(); Application_Service_MediaService::importFileToLibrary($callbackUrl, $filePath, $originalFilename, self::getOwnerId(), $copyFile);