Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » Cannot set custom folder for ImageField

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 5183 Views
  • stefant42
    Avatar
    Community Member
    14 Posts

    Re: Cannot set custom folder for ImageField Link to this post

    Silverstripe is often Buggy :

    Look @ this Line 142 till 155 in File Image.php :

          $file = ASSETS_PATH . "/$class/$file";
          
          while(file_exists(BASE_PATH . "/$file")) {
             $i = $i ? ($i+1) : 2;
             $oldFile = $file;
             $file = ereg_replace('[0-9]*(\.[^.]+$)',$i . '\\1', $file);
             if($oldFile == $file && $i > 2) user_error("Couldn't fix $file with $i", E_USER_ERROR);
          }

          
    if(file_exists($tmpFile['tmp_name']) && copy($tmpFile['tmp_name'], BASE_PATH . "/$file")) {
    ....

    WTF is BASE_PATH used?

    5183 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.