How to specify enctype in drupal form

    enctype in drupal form is specified where we have to upload files or media In drupal form you can specify in following way
    <?php
    function resumeupload_test_form() {
     
    $form['field_resume'] = array(
       
    '#type' => 'file',
       
    '#title' => t('CV Uploader'),
       
    '#required' => TRUE,
       
    '#size' => 22,
      );
     
    $form['upload'] = array(
       
    '#type' => 'submit',
       
    '#value' => t('Upload'),
      );

     
    //This is how enctype is specified
     
    $form['#attributes'] = array('enctype' => "multipart/form-data");
      return
    $form;
    }

    ?>
    5
    Average: 5 (1 vote)