PDA

View Full Version : xls2csv doesnt like me!


brew
03-29-2004, 07:33 PM
heyas - great little engine guys , installed her in minutes and after some tinkering i have both pdf and doc files getting indexed!

but for the life of me i cant get xls files to work. im using linux (suse9) and checked the file permissions on the relevant dirs ...

define('PHPDIG_INDEX_MSWORD',true);
define('PHPDIG_PARSE_MSWORD','/usr/local/bin/catdoc');
define('PHPDIG_OPTION_MSWORD','-s 8859-1');

define('PHPDIG_INDEX_PDF',true);
define('PHPDIG_PARSE_PDF','/usr/bin/pdftotext');
define('PHPDIG_OPTION_PDF','');
define('PHPDIG_PDF_EXTENSION','.txt');

define('PHPDIG_INDEX_MSEXCEL',true);
define('PHPDIG_PARSE_MSEXCEL','/usr/local/bin/xls2csv');
define('PHPDIG_OPTION_MSEXCEL','');
define('PHPDIG_MSEXCEL_EXTENSION','');

and i have managed to get results out of the cmd for xls2csv:

/usr/local/bin/xls2csv test.xls

"About",,"Choose",,"Study",,"International",,,"Business",,"Alumni",,"Jobs",,"Contact"

so i know its physically working on the server. anyone offer any help? would be great to get xls files as well as pdf/doc ones.

Charter
03-29-2004, 07:51 PM
Hi. Uncomment //print $answer."<br>\n"; in robot_functions.php and check the content type when PhpDig hits an XLS file, and then look for the following line in robot_functions.php and check whether the content type matches vnd.ms-excel or msexcel and if the latter try modifying the following line:

else if ($regs[2] == 'vnd.ms-excel' && PHPDIG_INDEX_MSEXCEL == true) {

brew
03-29-2004, 08:10 PM
fixed! okay heres the low down ...

im using apache2 and it seems the default mime.type for xls files is now application/excel (so i got it working by commenting out this line in my mime.types file in apache config dir and added one for application/vnd.ms-excel

you might want to add this extra application/excel in the next release of phpdig - given more and more users will be on apache2

thanks for your prompt help :)