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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

MP3 & Dom


Reply

4 Posts   697 Views

Avatar
otherjohn

1 October 2010 at 2:54am Community Member, 125 Posts

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'),
         ....
      );
      

Avatar
UncleCheese

1 October 2010 at 3:23am 4085 Posts

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

Avatar
otherjohn

1 October 2010 at 3:27am Community Member, 125 Posts

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.

Avatar
UncleCheese

1 October 2010 at 4:16am 4085 Posts

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

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