Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Uploading a Flash file (.swf) to a page

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

Page: 1
Go to End
Author Topic: 1009 Views
  • RonG
    Avatar
    Community Member
    11 Posts

    Uploading a Flash file (.swf) to a page Link to this post

    I created a new page type by extending Page. A requirement for the new page type is content editors to be able to add a Flash file (.swf).

    I added the following code to the page type (ProjectPage), but now struggling with modifying getCMSFields() to add the field to a tab:

    static $has_one = array(
    'Photo' => 'Image',
    'FlashHeader' => 'File'
    );

    Which FormField to use for uploaded files (not images) in addFieldToTab method?

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Uploading a Flash file (.swf) to a page Link to this post

    FileUploadField FileIframeField is probably your best bet.

  • RonG
    Avatar
    Community Member
    11 Posts

    Re: Uploading a Flash file (.swf) to a page Link to this post

    Where can I find information about FileUploadField?

    The following results in an error ("Fatal error: Class 'FileUploadField' not found in ..."):

    function getCMSFields() {

    ...

    $fields->addFieldToTab("Root.Content.Main", new FileUploadField('FlashHeader'));

    ...

    }

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Uploading a Flash file (.swf) to a page Link to this post

    FileIframeField sorry :S

    1009 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.