Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » MP3 & Dom

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 690 Views
  • otherjohn
    Avatar
    Community Member
    125 Posts

    MP3 & Dom Link to this post

    Hi Cheese and others!
    I have a podcast page setup that uses DOM. If the podcast file called "Attachment" is setup as a class "File", it will not recognized MP3s and instead classes them as type "FILE" in the DB. Which results in the MP3 functions not working. This function did work when using swfupload but not in Uploadify.

    If I set the the "Attachment" as class MP3, it works of course, but I need to allow other file types. Is FILE still the wrong class type?

    CODE:
    static $has_one = array (
          'Attachment' => 'FILE', // <-- WORKS FINE IF MP3
          'SermonCastPage' => 'PodCastPage'
       );
    public function getCMSFields_forPopup()
       {
          return new FieldSet(
             .....
    ......
             new FileUploadField('Attachment','Podcast Audio File'),
             ....
          );
          

  • UncleCheese
    Avatar
    4085 Posts

    Re: MP3 & Dom Link to this post

    Yeah, I got rid of that feature with Uploadify. I decided it was too assuming to assign a new class to your file automatically, and that wasn't really something that belonged in an upload handler.

    To save your files as MP3s, just cast them as "MP3" in your file relation instead of "File"..

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: MP3 & Dom Link to this post

    What happens if its a file extension of something like .wav or what not. Can I still class it as an MP3? or would that mess it up.

  • UncleCheese
    Avatar
    4085 Posts

    Re: MP3 & Dom Link to this post

    No, it's MP3 only. It's always been that way...

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

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