Hi there, I have extended class "File" to class "VideoFile" (which does some automatic screenshots after the upload etc).
Now I have also recognized how to use the Uploadfield (the Ajax Stuff) on the Frontend.
Here is now my Problem:
I create an Object Movie, which has a relation to one Video of class VideoFile
class Movie extends DataObject{
static private $db = array("Title" => "Varchar(255)");
static private $has_one = array("Video" => "VideoFile");
}
Adding Movies to the collection by using ModelAdmin in the Backend, when creating a new Movie, the relation is set correctly and the File gets saved as type VideoFile on upload (even if I did not saved the Movie Object previously).
When creating a Form in the Frontend, I can also use UploadField for the File, but how do I tell it, that the Uploaded File should be of Type VideoFile.
Normaly, when the Form is created, the relation to the Object that it will create (Movie) will be set, when the form was submitted and the method saveInto is run on a Movie Object.
Would be nice, if smeone can help me, finding the right parts in the code, that I have to write an extension for.
kind regards