I recently had a need to migrate a load of files from one site to another, and the use of something like Feeds or Migrate wasn't appropriate. I found the following suggestion at http://drupal.stackexchange.com/questions/23890/import-files-into-a-file-field-in-drupal-7:
196511 sites use the very well established Webforms module - so it has been a very popular module for some time. However, in some ways, it is getting a bit long in the tooth now, especially with some of the new features available in Drupal 7, such as Rules integration. So along comes a new upstart, Entityforms. This brings the webform functionality into standard use of the Drupal 7 field API, and is based on the well-
Although I'd probably create fields through the UI and export using the Features module (because I'm lazy), if you feel like adding fields to an entity programmatically, you might find http://drupal.org/node/1228878 helpful. That page actually covers:
I recommend the use of Entity API for a number of reasons. One reason is the Entity metadata wrapper. Although I haven't actually used this, I can see its benefits, and plan to use it soon. The Drupal Commerce set of modules makes extensive use of this.
What is allows is chainable access to all the properties of an entity. For example, if you have a node, and wanted to find the node author's email address and change it, you could do this as follows:
With Drupal 7's support for Field API, even the die-hard opponents of old-style CCK will find themselves using fields, and (hopefully) entities. But...how do you run a query efficiently on a field which could have multiple values?
The answer lies in EntityFieldQuery. Here are some examples of how it can be used:
$query = new EntityFieldQuery();