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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

Audio File Types


Go to End


6 Posts   2876 Views

Avatar
gakenny

Community Member, 153 Posts

7 May 2007 at 1:30pm

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

Avatar
Jedateach

Forum Moderator, 238 Posts

7 May 2007 at 3:17pm

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.

Avatar
Jedateach

Forum Moderator, 238 Posts

7 May 2007 at 3:55pm

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.

Avatar
Jedateach

Forum Moderator, 238 Posts

7 May 2007 at 5:33pm

Edited: 07/05/2007 5:35pm

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.

Avatar
gakenny

Community Member, 153 Posts

7 May 2007 at 8:52pm

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

Avatar
Jedateach

Forum Moderator, 238 Posts

9 May 2007 at 12:23pm

Edited: 09/05/2007 12:38pm

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.