4

I want to upload files to their normal directory under /sites/default/files/. So let's assume I have example.pdf uploaded to sites/sites/default/files/manuals/example.pdf.

I want the links to files look like http://example.com/manuals/example.pdf. I think it's simpler and looks more professional.

How can I achieve it with Drupal?

8
  • I was sure it was asked, but I can't find it. If it will not be marked as a duplicate, I'll post an answer in a day or two. Unless someone will want to answer, of course.
    – Mołot
    Commented Sep 3, 2013 at 13:11
  • easy for image drupal.org/project/image_field_url_replacer
    – Bala
    Commented Sep 3, 2013 at 13:22
  • There was a module that did that once upon a time. Doesn't seem to exist any more though
    – Clive
    Commented Sep 3, 2013 at 13:23
  • @Bala I've seen and used solution with mod_rewrite on receiving end and preprocess functions on url generating end - and that's what I planned to post. But I'm perfectly open for other answers.
    – Mołot
    Commented Sep 3, 2013 at 13:24
  • 3
    @Mołot Marketing folks literally run from my desk when they come to me with that crap ;D
    – Clive
    Commented Sep 3, 2013 at 13:33

1 Answer 1

6

File Aliases module allows you to use token customizable aliases for your uploaded files, giving you the ability to keep your file system organized as per usual while providing clean looking paths (i.e., no more '/sites/default/files/').

  • Customizable File Alias field using Node tokens. Support for:
    • Drupal core Upload module.
    • FileField module.
    • ImageField module.
    • Image module.
    • Comment Upload module.
  • Support for Private and Public file systems.
  • Support for Views output (Fields and Nodes).
  • Support for FileField Paths Retroactive and Active Updating.
7
  • 2
    Yes, that's it! Nice!
    – Clive
    Commented Sep 3, 2013 at 13:31
  • Good catch :) I'll probably accept it, but post the manual way later anyway.
    – Mołot
    Commented Sep 3, 2013 at 13:34
  • 1
    Does this work with the CDN module?
    – mpdonadio
    Commented Sep 3, 2013 at 14:04
  • @Mołot what do you expect, I can't understand what you are asking about the manual way
    – Bala
    Commented Sep 9, 2013 at 8:15
  • 1
    @Bala it should. It usually does. But for the guy who inspired me post this question it was too buggy to use, and there is a way to do it without this module. That's all. But your answer is fine and upvoted by me all right :)
    – Mołot
    Commented Sep 9, 2013 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.