Why can't I find my uploaded file on disk? I have a form with a file upload widget:

$form['myFile'] = array(
    '#tree' =&gt; false,
    '#type' =&gt; 'file',
    '#title' =&gt; t('Choose a file')
);


In the form validation handler, I upload the file and validate it with:

$validators = array(
    "file_validate_extensions" =&gt; array(variable_get("allowed_extensions")),
    "file_validate_size" =&gt; array(variable_get("max_image_size"))
);
$file = file_save_upload('myFile', $validators);
$form_state['file_storage']['myFile'] = $file;


Then, in the submit handler, I save the file using:

$file = $form_state['file_storage']['myFile'];
file_save($file);


This seems to work fine as I can find an entry for the file in the file_managed table:

+-----+-----+--------------+-----------------------------+------------+----------+--------+------------+
| fid | uid | filename     | uri                         | filemime   | filesize | status | timestamp  |
+-----+-----+--------------+-----------------------------+------------+----------+--------+------------+
|  49 |   1 | download.jpg | temporary://download.jpg    | image/jpeg |     5410 |      0 | 1350312114 |
+-----+-----+--------------+-----------------------------+------------+----------+--------+------------+


The problem is that I can't find the file anywhere on disk:

$ su -
Password:
# updatedb
# locate download.jpg
/home/me/Pictures/download.jpg


As you can see, the only download.jpg found is the one in my pictures folder which I passed into the form. I can't find anything on the server (in /var/www/). So where is the file? Is it a BLOB in the drupal database? Has it simply not been uploaded properly? If so, what did I do wrong?
You're just missing the third parameter for file_save_upload():


  $destination: A string containing the URI $source should be copied to. This must be a stream wrapper URI. If this value is omitted, Drupal's temporary files scheme will be used ("temporary://").


The uri in your table is temporary://download.jpg which seems to support that.

To save your file in the public file system you just need to pass that parameter in:

$destination = 'public://some/folder/';
$file = file_save_upload('myFile', $validators, $destination);