How can I add field content to an asset in code? I'm trying to upload an asset based on this code https://gist.github.com/sathoro/8178981
which works fine, but how can I add additional content fields during the upload? I would like to set the caption an additional fields like credit during the upload?
It propbably works to store the custom field directly with your new element model:

$assetFileModel-&gt;setContentFromPost(array(
    'captionFieldHandle' =&gt; $myCaption,
));