Reply to comment

We're using flexinode. I

We're using flexinode. I created a flexinode type 'attached' and set the the the node theme to open the attached document if one was present.

It's not perfect -
* if there is more than one attached file, it only opens the first one
* search doesn't index the document (yet)

But flexinode would let you use all kinds of metadata. I'm not sure what the deal is with the flexinode and CCK modules and whether this will last.

<?php

foreach ($files as $file)
{
       
header("Content-size: $file->filesize");
       
header("Content-type: $file->filemime");
       
readfile("/my dir/" . base_path() . $file->filepath);
        exit;
}

?>


<h3>Warning: no file attached to this node</h3>

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.