Load file of content by weight Let's suppose I have a simple content type with title, body and file fields, and file field is multi value. I create a piece of content and upload some file in my field. Finally my content is something like 

title : my title
body  : somebody text come in body

file  : 


file1   
file2   
file3


My question

I can change the order of files in node edit by drag them up or down, I want to know how I can load a file programmatically by its weight. I mean I want to upload a file that is shown first or second in node edit mode. How can I upload file form node programmatically, ordering by weight?
When you change the order, the changes are saved as the delta in the database. For example if your field was called file you would access $node-&gt;field_file[$node-&gt;language][delta]. In your example above, the second file would be $node-&gt;field_file[$node-&gt;language][1] as the first file would be 0