title: How to upload a file to a folder location in drupal module?
body: <p>How to upload a file to a folder location in drupal module way...
    I am creating a module(sample) in that i want to create a n upload file so that it should be stored in a particular location(folder).. with out using cck  pls help me ... i coded like this</p>
  
  <pre><code>$form['pem_file_upload'] ['certificates'] = array (
    '#type' =&gt; 'file',
    '#value' =&gt; 'upload',
    '#title' =&gt; t('upload your certificate file'),
    '#description' =&gt; t('Upload the certificate file which is helpfull in sending push messages to ios device'),
    '#default_value' =&gt; variable_get('certificates', ''),
  );
  
  variable_set('certificates', $form_state['values'] ['certificates']);
  
  $form['pem_file_upload'] ['certificates'] = array (
    '#type' =&gt; 'file',
    '#value' =&gt; 'upload',
    '#title' =&gt; t('upload your certificate file'),
    '#description' =&gt; t('Upload the certificate file which is helpfull in sending push messages to ios device'),
    '#default_value' =&gt; variable_get('certificates', ''),
  );
  
  variable_set('certificates', $form_state['values']['certificates']);
  </code></pre>