From a2e3738f668aeee35f05863ca7d9e83d6a67c271 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Sat, 30 Jun 2012 00:47:50 +1200 Subject: [PATCH] ENHANCEMENT: use UplocadField constructor combine with give the field allowedExtensions as array('jpg', 'git', 'png') to replace the SimpleImageField constructor --- code/TestFileUploadPage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/TestFileUploadPage.php b/code/TestFileUploadPage.php index 05bcc3f..eab67e2 100644 --- a/code/TestFileUploadPage.php +++ b/code/TestFileUploadPage.php @@ -10,9 +10,11 @@ class TestFileUploadPage_Controller extends TestPage_Controller{ $fields = new FieldList( new EmailField('Email', 'EmailField'), new FileField('AFile','FileField'), - new SimpleImageField('AImage','SimpleImageField') + $aImage = new UploadField('AImage','SimpleImageField') ); + $aImage->allowedExtensions = array('jpg', 'gif', 'png'); + $actions = new FieldList( new FormAction('addMember', "Add a member with two Files uploaded") );