3

I've created a Content type that allows me to upload files (specifically pdf's).

After uploading a pdf file and then linking to it in a static document, clicking the link gives me a download page. enter image description here

I want the link to open the pdf directly. I tried the recommendation at http://www.drupalgardens.com/content/file-content-type but get a similar page, without the link. enter image description here

Assistance in fixing this would be greatly appreciated!


Try it for yourself

There are three bulleted links on the page: http://roguepublishing.ca/content/Communicating_Science

The regular 'Table of contents' leads to a page with one URL on it. That is the same URL as the hard-coded 'Table of contents'. As you can see, using these links opens the pdf's.

The 'Resource' Content type has * Enable Display field is checked * Files displayed by default is checked * The Manage Display is set to "URL to file" If I change Manage Display to "Table of files", I get a table with a link to the file. Clicking that link launches the pdf.

Simply: how do I get Drupal to launch the pdf from the alias on the first page?

  • Are you using File Entity and/or Media? – mpdonadio Feb 24 '14 at 21:39
  • No. I set the allowed file types when creating the Content Type. – user26719 Feb 24 '14 at 21:49
  • possible duplicate of Provide contents of file field at node URL – Gokul N K Feb 25 '14 at 6:50
  • I've talked with neRok who is at the link provided by Gokul N K. It is not the same problem; File Alias cannot solve this problem. – user26719 Feb 27 '14 at 4:45
1

You are just linking to files, and the default action for the browser to take is to ask to download the file.
Files will sometimes automatically open if the browser is set up to do so.
If you want to make sure the pdf is always displayed, you will have to look into pdf viewer modules. Here is a site that compares a few.
https://drupal.org/node/1781960

  • I've added the TRY IT FOR YOURSELF to the original post so you can test it on your system. – user26719 Feb 27 '14 at 5:00
  • "Thanks for thinking I'm a complete idiot." I'm sorry, but I was just trying to help you with the question you asked before it was edited. With that attitude, you will get no more help from me. – 2pha Feb 27 '14 at 6:31
  • @ 2pha: not a problem. Even with my limited knowledge of Drupal, I know your answer is non-sensical. The images in the original post are clearly not those of the browser asking what action to take. – user26719 Feb 27 '14 at 14:32
1

Closing this discussion

I am surprised that Drupal has such advanced functionality in core, but such a simple task requires an external module. Apparently, File Entity will do this, but I haven't figured out how. Yet.
I have summarized and generalized the problem at https://drupal.org/node/2207001

Thanks,
Roy Jensen

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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