-when returning a file url for download, use the server address

that the server was contacted with.
This commit is contained in:
martin 2011-09-09 11:45:19 -04:00
parent 77068086b0
commit 8b09f82aa3
1 changed files with 5 additions and 3 deletions

View File

@ -438,9 +438,11 @@ class StoredFile {
* Get the URL to access this file.
*/
public function getFileUrl()
{
global $CC_CONFIG;
return "http://$CC_CONFIG[baseUrl]:$CC_CONFIG[basePort]/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
{
$serverName = $_SERVER['SERVER_NAME'];
$serverPort = $_SERVER['SERVER_PORT'];
return "http://$serverName:$serverPort/api/get-media/file/".$this->getGunId().".".$this->getFileExtension();
}
/**