function form_example_tutorial_10_submit

Submit handler for form_example_tutorial_10().

Related topics

File

form_example/form_example_tutorial.inc, line 791

Code

function form_example_tutorial_10_submit($form, &$form_state) {
    $file = $form_state['storage']['file'];
    // We are done with the file, remove it from storage.
    unset($form_state['storage']['file']);
    // Make the storage of the file permanent.
    $file->status = FILE_STATUS_PERMANENT;
    // Save file status.
    file_save($file);
    // Set a response to the user.
    drupal_set_message(t('The form has been submitted and the image has been saved, filename: @filename.', array(
        '@filename' => $file->filename,
    )));
}