PDA

View Full Version : indexation pdf doc et xls


yoann
09-26-2003, 07:49 AM
Dans le fichier « robot_functions.php » remplacer la partie de code :

$file_content = @file($uri);
if (!is_dir($prefix)) {
if (!@mkdir($prefix,0660)) {
die("Unable to create temp directory\n";);
}
}
$tempfile = $prefix.$temp_filename;
$f_handler = fopen($tempfile,'wb');
if (is_array($file_content)) {
fwrite($f_handler,implode('',$file_content));
}
fclose($f_handler);
$tempfilesize = filesize($tempfile);


par:


# $file_content = @file($uri);
$handle = fopen ($uri,"rb";);
$file_content = "";
do {
$data = fread($handle,8192);
if (strlen($data) == 0) { break; }
$file_content .= $data;
} while(true);
fclose($handle);

# if (!is_dir($prefix)) {
# if (!@mkdir($prefix,0660)) {
# die("Unable to create temp directory\n";);
# }
# }
$tempfile = $prefix.$temp_filename;
$f_handler = fopen($tempfile,"wb";);

fwrite($f_handler,$file_content);

# if (is_array($file_content)) {
# fwrite($f_handler,implode('',$file_content));
# }
fclose($f_handler);
$tempfilesize = filesize($tempfile);

Cette manipulation m'a permis l'indexation de mes fichiers xls, pdf et doc.