The current workflow when files are added is like this:
* Add the file (through the add form or media browser widget.
* The file is added, and the entity has been created.
* You can now edit the entity, when you add the entity through the add form, you get to the edit form immediately.
There are some problems with this, primarily since we actually can add files without inputting required fields. I propose that we change this to a two-step process:
1. The file is uploaded through the form, and we refresh the form through AJAX (with fallback of course). We don't store the file entity at this point.
2. Once we know what file we are dealing with, we know which bundle it should be associated with. This means we can attach the proper field form form using the right bundle, and all the normal validation can occur.
Step one needs to be pluggable somehow, since not all uploading methods involve uploading a file, like selecting a youtube video. We also need to store a reference to the file that we just uploaded so that we can delete it (on cron) if the field data is not validated.