If you are using Drupal, the chances are you probably are using Views/CCK as well. I recently came up against a problem where I couldn't link to the path of an attached file to a Views display. This is where the Relationships feature comes in. This allows us to find additional information linked to the node - in this case, the filepath.
First goto Relationships and add Upload: Attached Files as a new Relationship. Next goto the Field section and add (Files) File: Path as a new field, remembering to choose Exclude from display. This means we can still use the data without displaying the field. Also make sure this field comes first in the ordering.
Finally add the Field with which you want to use the filepath and choose Output this field as a link. Here you will be able to use the replacement pattern [filepath].


This seems very straight
This seems very straight forward but for some reasons my link is not linking directly to the pdf file instead, it's going to the page that contain the pdf file. I follow your steps..added the relationship and the rest of the fields. hit save. Went to the home page, click on the church bulletin that has the pdf file attached to it...expected result: display the pdf file content
actual result: display the page that contain the pdf...All i want is when the user click on the title link, it should then disply the pdf file content...
Awesome!! Helped me with
Awesome!! Helped me with linking a node title to the pdf uploaded on that node!
thanks!!!!
this was extremely helpful!
It also works for for Filefield files and images.
This helped me too
I ran into the same issue! I was working with a grid layout in Views, showing some PDFs. I wanted to link directly to the PDFs but could only get the fids from Upload: Attached files. Was about to hack something together or try FileField (but that would've been a re-uploading pain) when I thought hey, let's search the 'net a bit. I'd be surprised if upload filepath couldn't be accessed somehow.
And I found your post. Thank you! The versatility of the Drupal community never ceases to amaze me.
You rock, this saved my
You rock, this saved my morning, thanks.