title: Attach Image to Page with Uploadify in Silverstripe CMS
body: <p>We want to use the Uploadify module so Silverstripe CMS users can simply upload images that are then attached to Pages. At the basic level this is the code:</p>
  
  <pre><code>class Page extends SiteTree {
  
         static $has_many = array( 
           "PageImages" =&gt; "PageImage" 
        );
  
         function getCMSFields(){ 
            $fields = parent::getCMSFields(); 
            $fields-&gt;addFieldToTab("Root.Content.PageImages", new MultipleFileUploadField('PageImages','Add Images to Page'));       
            return $fields; 
         } 
      }
  
      class PageImage extends Image { 
  
         static $has_one = array( 
            "Page" =&gt; "Page" 
         ); 
  
      }
  </code></pre>
  
  <p>However when a file is Uploaded through the "Upload New" tab it isn't automatically attached to the page. We thought this would be the default behaviour.</p>
  
  <p>Instead CMS users have to click on the "Choose existing" tab and select/ Import the images they are after.</p>
  
  <p>I'm guessing we've missed something very very simple, any help would be appreciated.</p>