The "Magic View" that handles the /download/ url is directed to a function:
view_jrCore_download_file().
Inside that function there IS an event firing that you can use the "Events and Listeners" system to listen for in your module, the event is
'download_file'
So if your module listens for that event, then when you return $_data if you have set:
$_data['download_file_name'] = "whatever_you_want.???"
That will set your file name.
You can see an example of a module using a listener for that event in the jrGallery module.
in the _init() function it does:
jrCore_register_event_listener('jrCore', 'download_file', 'jrGallery_download_file_listener');
Then in the include.php file is that function jrGallery_download_file_listener() which looks like this:
function jrGallery_download_file_listener($_data, $_user, $_conf, $_args, $event)
{
if (isset($_args['module']) && $_args['module'] == 'jrGallery') {
if (!isset($_conf['jrGallery_download']) || $_conf['jrGallery_download'] != 'on') {
header('HTTP/1.0 403 Forbidden');
header('Connection: close');
jrCore_notice('Error', 'you do not have permission to download this file');
exit;
}
}
return $_data;
}
for you, you'd adjust the internals to get the name right.