开发者

where to change the absolute path for uploads? sfConfig::get('sf_upload_dir')

i have this code:

 $profile_pic = sfConfig::get('sf_upload_dir') . '/rainbowcode/profilepics/'.$this->msisdn.".png";

and changed it to: $profile_pic = '/home/rainbowcode/rainbowcode_deploy_versions/profilepics/'.$this->msisdn.".png";

the above directory path does exist and the actual file开发者_如何学Python also does exist but for some or other reason it is not finding my file???

i found this: http://www.symfony-project.org/cookbook/1_0/en/upload where it states that you can configure the absolute path in config/config.php but i dont have a config.php

i dont understand, please help thanks


See documentation about customizing path. http://www.symfony-project.org/gentle-introduction/1_4/en/19-Mastering-Symfony-s-Configuration-Files#chapter_19_sub_customizing_the_file_structure

You should override sf_upload_dir in config/ProjectConfiguration.class.php


I think you can override setwebdir method in your /config/ProjectConfiguration.class.php

public function setWebDir($webDir)
{
    sfConfig::add(array(
      'sf_web_dir'    => $webDir,//dont change this if you dont have to
      'sf_upload_dir' => $webDir.DIRECTORY_SEPARATOR.'uploads',//thats what you wanted to change :)
    ));
}  

Check this post:
http://oldforum.symfony-project.org/index.php/m/84548/


Actually you don't need to configure upload path. Please make sure the $this->msisdn returns smth.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜