Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Add file upload types


Reply


4 Posts   1538 Views

Avatar
gman

Community Member, 11 Posts

10 August 2010 at 3:05pm

I noticed that by default .odt is not an allowed file upload. Where do you change the file types allowed for upload?

Avatar
swaiba

Forum Moderator, 1805 Posts

10 August 2010 at 8:11pm

I think something like the following might help... this means you have to intercept the field in getCMSfields and also not that these are case sensitive.... please look at sapphire\forms\FileField.php for more info....

$uploadField->setAllowedExtensions('odt');

Avatar
Invader_Zim

Community Member, 141 Posts

11 August 2010 at 12:19am

An alternative solution would be to add this line

File::$allowed_extensions[] = 'odt';


to your mysite/_config.php.

Cheers,
Christian

Avatar
Brendo

Community Member, 7 Posts

10 December 2013 at 4:53pm

Gman,

did you solve your issue?

do you have any problems linking or accessing the file once uploaded?

regards

Brendon