By ninetwenty on
I want to write a module that allows downloading of a file by referencing the node the file is attached to. For example, if I have a file word.doc attached to node 242 I want to be able to access it via someting like node/242/file/word.doc or if there is an alias for node 242 such as documents then, documents/file/word.
Is this possible? I've noticed it probably isn't possible with the alias in the way I've specified as the alias system needs an exact match. Could it be done with documents?file=word.doc?
Comments
custom_url_rewrite
Cracked it! I can use custom_url_rewrite in my settings.php to translate anything where the next to last argument matches /file/ into system/files/filename, this will give me nice easy filename references for my users.