How do I upload files in a custom form?
I just created a custom extension that uploads a  CSV file and reads it into a table.

I added the file element in buildQuickForm as follows

  $this-&gt;add('File', 'uploadFile', ts('Import Data File'), 'size=30 maxlength=255', TRUE);


And the processing of the file was is done  with

public function preProcess()
{
    if (isset($this-&gt;_submitFiles['uploadFile'])) {
        $uploadFile = $this-&gt;_submitFiles['uploadFile'];
        $importer = new CRM_Importer();
        $importer -&gt;truncate();
        $importer -&gt; importCVStoTable($uploadFile['tmp_name']);
    }
}


I think the key element is $this-&gt;_submitFiles and you already found about the tmp_name