Forum OpenACS Development: RFC: File conversion for search callback

I want to define a callback for converting file content to text (or some other format, ie: html) so that the executable programs are not hard coded into the procedures.

Something like this:

callback search::convert {
-file_path {
 Convert from one mime_type to another, probably calling an external utility
} -

An implementation would look like:

ad_proc -callback search::convert -impl application/pdf__text/plain {
            #use pdftotext to convert PDF file to text
             return [exec pdftotext $data -]
}

So the implementation name is ${from_mime_type}__${to_mime_type}

Any comments?
Collapse
Posted by Malte Sussdorff on
Besides: I guess this will work and good thinking, none.