<html> <head> <title>MHonArc Resources: ATTACHMENTDIR</title> <link rel="stylesheet" type="text/css" href="../docstyles.css"> </head> <body> <!--x-rc-nav--> <table border=0><tr valign="top"> <td align="left" width="50%">[Prev: <a href="archive.html">ARCHIVE</a>]</td><td><nobr>[<a href="../resources.html#attachmentdir">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="attachmenturl.html">ATTACHMENTURL</a>]</td></tr></table> <!--/x-rc-nav--> <hr> <h1>ATTACHMENTDIR</h1> <!--X-TOC-Start--> <ul> <li><a href="#syntax">Syntax</a> <li><a href="#description">Description</a> <li><a href="#default">Default Setting</a> <li><a href="#rcvars">Resource Variables</a> <li><a href="#examples">Examples</a> <li><a href="#version">Version</a> <li><a href="#seealso">See Also</a> </ul> <!--X-TOC-End--> <!-- *************************************************************** --> <hr> <h2><a name="syntax">Syntax</a></h2> <dl> <dt><strong>Envariable</strong></dt> <dd><p> <code>M2H_ATTACHMENTDIR=</code><var>pathname</var> </p> </dd> <dt><strong>Element</strong></dt> <dd><p> <code><ATTACHMENTDIR></code><br> <var>pathname</var><br> <code></ATTACHMENTDIR></code><br> </p> </dd> <dt><strong>Command-line Option</strong></dt> <dd><p> <code>-attachmentdir </code><var>pathname</var> </p> </dd> </dl> <!-- *************************************************************** --> <hr> <h2><a name="description">Description</a></h2> <p>ATTACHMENTDIR specifies the pathname directory location attachments will be saved. If ATTACHMENTDIR is a relative pathname, it will be relative to <a href="outdir.html">OUTDIR</a>. For example, if OUTDIR is set to: </p> <pre> /var/www/html/archive </pre> <p>And ATTACHMENTDIR is set to: </p> <pre> attachments </pre> <p>Then attachment files will be saved to </p> <pre> /var/www/html/archive/attachments </pre> <p>If ATTACHMENTDIR is not set, attachments will be saved in <a href="outdir.html">OUTDIR</a>. </p> <p>When defining ATTACHMENTDIR, the <a href="attachmenturl.html">ATTACHMENTURL</a> resource should also be set. </p> <!-- *************************************************************** --> <hr> <h2><a name="default">Default Setting</a></h2> <p><i>Nil</i>. </p> <!-- *************************************************************** --> <hr> <h2><a name="rcvars">Resource Variables</a></h2> <p>N/A </p> <!-- *************************************************************** --> <hr> <h2><a name="examples">Examples</a></h2> <p>By default, attachment files are written in the same directory as message and index pages. However, if you would like to have all attachments written in a sub-directory of the archive directory, you can do something like the following: </p> <pre class="code"> <!-- Have attachments written to a sub-directory --> <b><AttachmentDir></b> attachments <b></AttachmentDir></b> <!-- Define base URL to attachment directory. --> <b><<a href="attachmenturl.html">AttachmentURL</a>></b> attachments <b></AttachmentURL></b> </pre> <p>Notice how <a href="attachmenturl.html">ATTACHMENTURL</a> is equal to ATTACHMENTDIR. When ATTACHMENTDIR is set to a relative pathname, ATTACHMENTURL should be set to the same value. This way, if archive files are moved to a different location on the file system, links to attachments will not break. </p> <p>If maintaining multiple archives, and to provide for better security, you may want have all attachments for all archives written to a single location. The attachment location can then have more restrictive HTTP server and file system settings to provide further protection against malicious attachments. </p> <p>The following example shows ATTACHMENTDIR being set to a central location and then defining <a href="attachmenturl.html">ATTACHMENTURL</a> so MHonArc knows what base URL to use when creating links to attachment files: </p> <pre class="code"> <!-- Have all attachments written to central location --> <b><AttachmentDir></b> /var/www/html/archives/attachments <b></AttachmentDir></b> <!-- Define base URL to attachment directory. --> <b><<a href="attachmenturl.html">AttachmentURL</a>></b> /archives/attachments <b></AttachmentURL></b> </pre> <p>In this case, <a href="attachmenturl.html">ATTACHMENTURL</a> does not equal ATTACHMENTDIR since ATTACHMENTDIR is a full pathname. Therefore, ATTACHMENTURL must be set to a value tha HTTP server will resolve to the value of ATTACHMENTDIR. </p> <table class="note" width="100%"> <tr valign="baseline"> <td><strong>NOTE:</strong></td> <td width="100%"><p>In this example, we do not include the "<tt>http://<i>hostname</i></tt>" part of the URL since attachment files will be served up from the same HTTP server as other archive pages. </p> </td> </tr> </table> <!-- *************************************************************** --> <hr> <h2><a name="version">Version</a></h2> <p>2.6.9 </p> <!-- *************************************************************** --> <hr> <h2><a name="seealso">See Also</a></h2> <p> <a href="attachmenturl.html">ATTACHMENTURL</a>, <a href="outdir.html">OUTDIR</a> </p> <!-- *************************************************************** --> <hr> <!--x-rc-nav--> <table border=0><tr valign="top"> <td align="left" width="50%">[Prev: <a href="archive.html">ARCHIVE</a>]</td><td><nobr>[<a href="../resources.html#attachmentdir">Resources</a>][<a href="../mhonarc.html">TOC</a>]</nobr></td><td align="right" width="50%">[Next: <a href="attachmenturl.html">ATTACHMENTURL</a>]</td></tr></table> <!--/x-rc-nav--> <hr> <address> $Date: 2003/10/06 22:04:16 $<br> <img align="top" src="../monicon.png" alt=""> <a href="http://www.mhonarc.org/"><strong>MHonArc</strong></a><br> Copyright © 2003, <a href="http://www.earlhood.com/" >Earl Hood</a>, <a href="mailto:mhonarc%40mhonarc.org" >mhonarc<!-- -->@<!-- -->mhonarc.org</a><br> </address> </body> </html>