Is there a way to rewrite a url to go to a file stored in the filefield of the node

Posted by kidbrax on Stack Overflow See other posts from Stack Overflow or by kidbrax
Published on 2010-03-30T15:55:33Z Indexed on 2010/03/31 0:03 UTC
Read the original article Hit count: 358

Filed under:
|

I have a custom content-type called 'document' On this content-type, I have a File field where a user can upload a document.

Assume the path to a document node is /somesite/document/tester

I would like to be able to link to /somesite/document/tester/file and it automatically go to the file that is uploaded to the file field of the node. I have tried the url_alter module and am able to get the correct url of the document but when it tries to go there, it says not found. It seems that my redirection is still trying to be rewritten with pathauto or something.

Ulitamtely, we want to have a consistent url for these documents so that a user can upload a replacement document and we can still use the same urls. Any ideas?

© Stack Overflow or respective owner

Related posts about drupal

Related posts about php