function student_files_upload_any_student_files_form_submit
Search API
7.x student_files.module | student_files_upload_any_student_files_form_submit($form, &$form_state) |
6.x student_files.module | student_files_upload_any_student_files_form_submit($form, &$form_state) |
We can assume at this point that eveything is peachy, so let's get to uploading!
File
- modules/
student_files/ student_files.module, line 239 - This is the student_files module, which will facilitate uploading (securely) files to be associated with student accounts.
Code
function student_files_upload_any_student_files_form_submit($form, &$form_state) {
$values = $form_state ["values"];
$cwid = @trim($values ["manual_cwid"]);
$method = $values ["student_method"];
$access_type = $values ["access_type"];
foreach ($form_state ["student_files"] as $file) {
$use_cwid = $cwid;
if ($method == "filename") {
$use_cwid = $file ["cwid"];
}
$file ["cwid"] = $use_cwid; // make sure its in there.
// To get it to correctly save, we need to place a value into the $_FILES global array...
$file ["access_type"] = $access_type;
// Now, call our upload handler.
student_files_handle_upload($use_cwid, FALSE, $file);
}
// And that's it! We are now finished.
}