<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; color: #000000"><div>Hi Folks,</div><div><br></div><div>Not sure how to proceed...</div><div><br></div><div>I want to be able to download files with a click, not a right-click context menu item. &nbsp;This is pretty easy. &nbsp;I have a custom formatter that will present the file as the argument to a script. &nbsp;The custom formatter looks like this:</div><div><br></div><div><p style="margin: 0px; padding-left: 30px;"><span style="font-size: x-small;">$s = '&lt;a href="' . drupal_get_path('module', 'download') . '/download.php?file=' . $variables['#items'][0]['uri'] . '"&gt;';</span><br><span style="font-size: x-small;">$s .= '&lt;img class="file-icon" alt="" title="audio/mpeg" src="/modules/file/icons/audio-x-generic.png"&gt;';</span><br><span style="font-size: x-small;">$s .= '&lt;/a&gt;';</span><br><span style="font-size: x-small;">echo $s;</span></p></div><div style="padding-left: 30px;"><br></br></div><div>And the script is equally simple:</div><div><br></div><div><p style="margin: 0px; padding-left: 30px;"><span style="font-size: x-small;">header('Content-Description: File Transfer');</span><br><span style="font-size: x-small;"> header('Content-Type: application/octet-stream');</span><br><span style="font-size: x-small;"> header('Content-Disposition: attachment; filename='.basename($file));</span><br><span style="font-size: x-small;"> header('Content-Transfer-Encoding: binary');</span><br><span style="font-size: x-small;"> header('Expires: 0');</span><br><span style="font-size: x-small;"> header('Cache-Control: must-revalidate, post-check=0, pre-check=0');</span><br><span style="font-size: x-small;"> header('Pragma: public');</span><br><span style="font-size: x-small;"> header('Content-Length: ' . filesize($file));</span><br><span style="font-size: x-small;"> ob_clean();</span><br><span style="font-size: x-small;"> flush();</span><br><span style="font-size: x-small;"> readfile($file);</span><br></p></div><div style="padding-left: 30px;"><br></br></div><div>So, here's the question. &nbsp;I need this script to be a module, so the custom formatter can find it (drupal_get_path()). &nbsp;I have a trivial download.info and an empty download.module. &nbsp;This is really just a utility script and not really a module. &nbsp;What is the recommended way to "register" this script for general use? &nbsp;hook_menu?</div><div><span style="font-size: 10pt;"><br></span></div><div><span name="x"></span>Chris.</div></div></body></html>