. */ /** * @brief Frame to choose a file to index * * @file choose_file.php * @author Claire Figueras * @date $date$ * @version $Revision$ * @ingroup indexing_searching_mlb */ $core_tools = new core_tools(); $core_tools->load_lang(); $func = new functions(); $core_tools->load_html(); $core_tools->load_header('', true, false); $upFileOK = false; $_SESSION['with_file'] = false; ?> 1) { $extension = explode(".",$_FILES['file']['name']); $count_level = count($extension)-1; $the_ext = $extension[$count_level]; $fileNameOnTmp = 'tmp_file_' . $_SESSION['user']['UserId'] . '_' . rand() . '.' . strtolower($the_ext); $filePathOnTmp = $_SESSION['config']['tmppath'] . $fileNameOnTmp; if (!is_uploaded_file($_FILES['file']['tmp_name'])) { $_SESSION['error'] = _FILE_NOT_SEND . ". " . _TRY_AGAIN . ". " . _MORE_INFOS . " (" . $_SESSION['config']['adminname'] . ")"; } else { require_once 'core/docservers_tools.php'; $arrayIsAllowed = array(); $arrayIsAllowed = Ds_isFileTypeAllowed($_FILES['file']['tmp_name'], strtolower($the_ext)); if ($arrayIsAllowed['status'] == false) { $_SESSION['error'] = _WRONG_FILE_TYPE . ' ' . $arrayIsAllowed['mime_type']; $_SESSION['upfile'] = array(); } elseif (!@move_uploaded_file($_FILES['file']['tmp_name'], $filePathOnTmp)) { $_SESSION['error'] = _FILE_NOT_SEND . ". " . _TRY_AGAIN . ". " . _MORE_INFOS . " (" . $_SESSION['config']['adminname'] . ")"; } else { $_SESSION['upfile']['size'] = $_FILES['file']['size']; $_SESSION['upfile']['mime'] = $_FILES['file']['type']; $_SESSION['upfile']['local_path'] = $filePathOnTmp; //$_SESSION['upfile']['name'] = $_FILES['file']['name']; $_SESSION['upfile']['name'] = $fileNameOnTmp; $_SESSION['upfile']['format'] = $the_ext; $upFileOK = true; } } } elseif ($_REQUEST['with_file'] == 'true') { $_SESSION['with_file'] = true; $pathToFile = 'apps/' . $_SESSION['config']['app_id'] . '/_no_file.pdf'; if (is_file('custom/'.$_SESSION['custom_override_id'].'/'.$pathToFile)) { $pathToFile = 'custom/'.$_SESSION['custom_override_id'].'/'.$pathToFile; } $_SESSION['upfile']['size'] = filesize($pathToFile); $_SESSION['upfile']['mime'] = 'application/pdf'; $fileNameOnTmp = 'tmp_file_' . $_SESSION['user']['UserId'] . '_' . rand() . '.pdf'; $_SESSION['upfile']['name'] = $fileNameOnTmp; $filePathOnTmp = $_SESSION['config']['tmppath'] . $fileNameOnTmp; $_SESSION['upfile']['local_path'] = $filePathOnTmp; if (copy($pathToFile, $filePathOnTmp)) { $upFileOK = true; } } elseif ($_REQUEST['with_file'] == 'false') { $_SESSION['upfile'] = array(); $upFileOK = true; } //if ($upFileOK) { ?>

type="radio" name="with_file" id="with_file2" value="true" onclick="this.form.method = 'post';this.form.submit();" /> type="radio" name="with_file" id="with_file" value="false" onclick="this.form.method = 'post';this.form.submit();" />

load_js();?>