How to use managed_file to upload many files I'm looking for a way to upload many files by means of the managed_file form API element. I would like it be like while uploading for node where is 'add new item' button.
How to do it?
You may want to use plupload form element instead. Install Plupload integration module and then use something like:

$form['my_element'] = array(
  '#type' =&gt; 'plupload',
  '#title' =&gt; t('Upload files'),
  '#description' =&gt; t('This multi-upload widget uses Plupload library.'),
  '#upload_validators' =&gt; array(
    'file_validate_extensions' =&gt; array('jpg jpeg gif png txt doc xls pdf ppt pps odt  ods odp'),
    'my_custom_file_validator' =&gt; array('some validation criteria'),
  ),
  '#plupload_settings' =&gt; array(
    'runtimes' =&gt; 'html5',
    'chunk_size' =&gt; '1mb',
  ),
);