Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Audio File Types

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 2229 Views
  • gakenny
    Avatar
    Community Member
    153 Posts

    Audio File Types Link to this post

    Hello,

    I would like to develop a site that allows audio file types to be uploaded with relevant notes, etc. Is there a working example or some notes on how this might be achieved? I am reluctant to allow uploads using HTTP as we might get timeout issues and I am wondering if the file can be uploaded and I can perform a lookup of a specified folder to link to this file via the backend interface for SilverStripe.

    Thanks for any help!

    Cheers,

    Gary

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Audio File Types Link to this post

    You can upload files to the assets folder via ftp or scp. After visiting the "Files & Images" tab in the CMS, all the references to the files will automatically be stored in the database. You could then use these references to output a list on a page.

    Sorry, I don't know of any working examples myself. Hope this helps.

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Audio File Types Link to this post

    The database stores what folder the file is in, so you make an SQL query that lists all files in a particular directory, and are of type .mp3 for example.

    If you wanted to add a description for each file, I noticed that the "content" field is unused in the 'File' table...meaning you won't have to create another table to join to for adding a description.

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Audio File Types Link to this post

    Ok...I've since learned that the "Content" field is used for the description of the file.

    From the IRC you told us that you're working on a site to contain pages of type 'seminar'. You need to be able to select a sound file to link to in the seminar page for users to download/listen to.

    Within the Seminar.php file you can add a field to the $has_one array for storing the specific file you want to attach. Within the getCMSFields function, as per tutorial 2, you can add a 'TypeDropdown' field to the main tab.

    You would then reference the field added to the $has_one in the Seminar.ss file to create a link to the file.

    This is quite a rough description of what you can do. Please ask if you need a hand with the details.

  • gakenny
    Avatar
    Community Member
    153 Posts

    Re: Audio File Types Link to this post

    Hi Jez,

    Thanks for the heads-up... Are these field types documented somewhere?

    The more I see of this tool the more I can see it's flexibility. I think I'll get the basic framework together and then work on this for v1.1.

    Cheers,

    Gary

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: Audio File Types Link to this post

    Yes, you should be able to find what you need in the "Developer Tutorials & Docs" area:
    http://doc.silverstripe.com/doku.php?id=all-classes

    Edit: Key word there being "should". We're making our best efforts to get the API documentation fleshed out.

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