Have you confirmed that mod_security is not running?
Hi Uncle, i have a weird problem with ImageDataObjectManager, i cant import images from folders:
this is my code...
$Ads = new ImageDataObjectManager( $this, 'InteractionBanners', 'InteractionBanner', 'InteractionBtn', array( 'LinkText' => 'LinkText', 'Link' => 'Link' ), 'getCMSFields_forPopup' ); $Ads->setPageSize(100); $f->addFieldToTab( 'Root.Content.InteractionBanners', $Ads );
i dont understand what is missing, but if i upload a new file this file all works ok.
Yea you were right it was just a mod_security problem - I shoulda thought about that!
File types that are not in the allowedFileTypes array will get greyed out. In ImageDOM, I believe that defaults to gif, jpg, and png. You can always set it manually with setAllowedFileTypes().
thanks for the quick response :)
i have tried this:
$Ads = new ImageDataObjectManager( $this, 'InteractionBanners', 'InteractionBanner', 'InteractionBtn', array( 'LinkText' => 'LinkText', 'Link' => 'Link' ), 'getCMSFields_forPopup' ); $Ads->setAllowedFileTypes(array('jpg','png','gif'));
but i think thats not the way it works.. can you provide an example?
when i have added that i get a blank screen with the following error:
ImageDataObjectManager::setAllowedFileTypes() -- Only files of type jpg, jpeg are allowed.
Yeah, that's right. I excluded png because at the time Silverstripe couldn't resample PNG in its GD class. I'll update the code to allow PNG. For now, just add it to the $limitFileTypes array in ImageDOM.
by the way, it seems that silverstripe now can resample pngs correctly.. i have modified your class some moments ago and with pngs works, but not with transparent gifs (transparency renders black) and both are correctly resized
I'm having an issue where if I upload an image in 'Files & Images' to a subfolder, the files go straight into the root of the assets folder and not into the folder I want them to.