Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » filefield $allowed_file_types help

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1753 Views
  • spunktastica
    Avatar
    Community Member
    2 Posts

    filefield $allowed_file_types help Link to this post

    So I want to add a file upload to a page. I want the user to only upload pdf's. I've looked through the tutorials and the documentation and I've managed to add a filefield but I don't have a clue how to limit it to PDF. I found the $allowed_file_types property but don't know how to apply it. Can someone help me?

    $fields->addFieldToTab("Root.Content.Files", new FileField('Pdf'))

    Thanks

    1753 Views
Page: 1
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.