Posted by Letharion on February 24, 2012 at 10:27am
I haven't studied the code for file-fields in any detail, so perhaps some of my assumptions are wrong.
But here are my assumptions, each one based on the previous:
- As files are their own entities, they don't "need" a field for storage. This seems true since I can delete file fields without loosing media content.
- File fields are therefore really a type of reference field.
- File fields probably duplicate code that is more general in either, or both of entity reference and relation
- We could use entirely replace field fields with entity references/relations.
The reason I'm asking, is because I would like to enable the already awesome plupload functionality on file/add, also directly on fields. I wanted to ask about this before I got started, so that I don't implement this for the "wrong" field type.

Comments
I'm no expert, but maybe I
I'm no expert, but maybe I can address number 1.
In D7 core files are entities, but they aren't fieldable entities. The http://drupal.org/project/file_entity module makes the core file entities into fieldable entities.
The media module provides a widget for file and image fields that enable you to upload, select, edit media, and browse the media library.
Not sure if that helps
I think it would be cool if a module would provide a "Batch upload" button below all fields that use the media widget like "file or image fields" that would allow you select multiple files at once using plupload. This would still allow you to also have the media widget for single uploads, selections, editting, etc.
There are already some plupload modules that work with file and image fields, but they can't use the media widget at the same time.
For example
http://drupal.org/project/plup
http://drupal.org/project/1115362
http://drupal.org/project/multiupload_imagefield_widget
The problem here is that the
The problem here is that the file and image fields are provided by core, so everyone's using those (and we add the Media widget on top of that) and not entity_reference for files. Entity reference is more like a generic replacement for the node reference and user reference modules.
Entity reference is not well-suited for files or images since the entity reference module can only reference existing items and not create new entities in the widget, like we need with files and images (when a user uploads a new file or image, they are creating a new file entity).
I would strongly consider you take a look at the plupload integration that you get with the Media module and plupload module (http://drupal.org/project/plupload) enabled, or http://drupal.org/project/plup.
Senior Drupal Developer for Lullabot | www.davereid.net | @davereid
Thank you for your comments
Thank you for your comments :)
I have tried plupload (and multiform), and found that it works very well, but is limited to file/add. I'm doing some research for a gallery that may be deployed on a large number of sites, and because of that I want to "get it right". One of the things we're trying to do in <a href = "http://drupal.org/project/nodestream>NodeStream is standardize everything on using ERs. The exception being Term references because they provide some more magic that ERs do not.
We use References dialog to overcome the fact that one cannot create new entities with bare ERs.
I guess I could re-phrase my question to: Would there be something inherently "wrong" with a module that attempts to bridge the three modules file entities, entity references and plupload?
I to was wondering about
I to was wondering about using http://drupal.org/project/references_dialog with Entity Reference fields.
I know you could create a new file entity using references_dialog and an ER field, but how were thinking you can handle adding other media like youtube videos or flickr photos?
Would you detect that the ER field is only referencing media entity types and change the "add new" icon to popup the media selector widget?
This is way out there, but maybe we need a field_buttons_api.module that references_dialog, media module, http://drupal.org/project/nodeconnect or plupload(for a bulk upload icon) could hook into to add their icons/buttons to fields.
My initial thought would be
My initial thought would be applying the existing media browser widget to entity references. Whether or not that's reasonbly doable I don't know at this point.
Isn't widgets in the field api already capable of doing what you suggest field_buttons_api should do? :)
My initial thought would be
My initial thought would be applying the existing media browser widget to entity references. Whether or not that's reasonbly doable I don't know at this point.
- Dave Reid would need to comment on this one.
Isn't widgets in the field api already capable of doing what you suggest field_buttons_api should do? :)
- Not sure, haven't ever tried. I just see each one of these modules adding icons/buttons to fields. I didn't know if there was any standardization for that.