function set_note($case_id = '', $user_id = '', $note = '', $file_id = '') { ob_start(); $insert_sql_array = array(); $insert_sql_array[module_id] = $case_id; $insert_sql_array[user_id] = $user_id; $insert_sql_array[description] = $note; $insert_sql_array[module_name] = 'CASES'; $this->db->insert(CASE_NOTES, $insert_sql_array); $note_id = $this->db->last_insert_id(); $this->page->log_activity('CASES', $case_id, 'note_added', '', $note, 'notes', $note_id); //FILESERVER_LOCAL_PATH //TMP_UPLOAD $fileserver = new fileserver(); echo TMP_UPLOAD . $file_id . "\n"; echo is_dir(TMP_UPLOAD . $file_id) . "\n"; if (is_dir(TMP_UPLOAD . $file_id) == true && $file_id != '') { $from_dir = TMP_UPLOAD . $file_id; echo __LINE__ . "\n"; $dh = opendir($from_dir); while ($file = readdir($dh)) { if (is_file($from_dir . "/" . $file)) { $filearr = array(); $filearr["tmp_name"] = $from_dir . "/" . $file; $filearr["name"] = $file; //var_dump( $filearr); echo $fileserver->upload_file($note_id, 'notes', '', $filearr); } } } $html = ob_get_contents(); ob_end_clean(); //return $html; }
require_once 'class/global.config.php'; require_once 'class/database.inc.php'; require_once 'class/class.fileserver.php'; $fileserver = new fileserver(); $fileserver->check_fileUpload(); ?> <head> <script type="text/javascript" src="js/jquery.min.js"></script> </head> <form name="myform" action="tmp.fileserver.php" method="post" enctype="multipart/form-data" > <input id="fileUplaod" type="file" size="45" name="fileUpload" class="input" ></input> <input id="something" type="text" name="something" value="Yup" ></input> <input type="submit" ></input> </form> <?php echo $fileserver->display_files('1', 'tmp'); ?> <textarea style="width:100%;height: 80%" > <?php print_r($_FILES); echo "\n\n"; print_r($_REQUEST); echo "\n\n"; print_r($_POST); if (is_array($_FILES["fileUpload"])) { echo "YES\n"; $fileserver->upload_file('1', 'tmp', '1', $_FILES["fileUpload"]); } ?> </textarea>