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.

Archive

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

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

filefield $allowed_file_types help


Reply

1764 Views

Avatar
spunktastica

19 June 2008 at 5:30am Community Member, 2 Posts

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