So, I'm trying to setup a DataObject to have a file ( static $has_one = array ('Song'=>'File'); ). Because the file must be an Mp3 to work properly, I'm attempting to setup SS to force the user to upload an MP3. I have tried everything under the sun to make this happen with absolutely no luck.
Here's what I've tried --
Extending the File DataObject with an Mp3File descendant. On that class I set the static $allowed_file_types to an array with one value, 'mp3' -- the result: nada. Works just like an unmodified File dataobject.
Using getCMSFields() to grab the FieldIFrameField and specify allowed types -- the result: no dice specifying anything about the file at all. The FileIFrameField seems to accept absolutely anything and everything within the size range permitted with no way to modify it.
Using the FileDataObjectManager by adding a FileDataObjectManager in place of the FileIFrameField. The Result: Closer, but no apparent way to just populate a has_one field. Also, I got errors on processing the upload every time. Not sure what to make of it. I piddled with the HasOneFileDataObjectManager class, but couldn't get it working at all.
Replacing the FileIFrameField with a FileField and setting that field to permit the proper filetype with setAllowedExtensions. The Result: No dice. Seems to have no effect at all.
Fetching the trunk version of the FileIFrameField which is allgedly a fixed version. Result: No successful uploads at all. Allows me to select any file and when I attach the file, the iFrame refreshes to the form with no indication of success or failure.
If anyone has solved this, I would love to know how you did it. Thanks!