0
Welcome Guest! Login
0 items Join Now

Is there a module that allows users to download a PDF file?

  • Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • Is there a module or code for me to include that allows me to have a PDF file uploaded into the media manager or in my cpanel that a viewer can click to download?
    • Last Edit: 14 years 7 months ago by Brent Ragan.
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • You can upload pdf's just like you would images in your media manager. To have the users download it, just provide a link to it and most browsers will prompt the user to "Save this file".
      <a href="images/stories/MY_PDF_FOLDER/MY_PDF.pdf" target="_blank">The Link Text That I Want</a>

      The target="_blank" is there to make the link open up in a new tab or window. This is nice for pdf because it will open it in the browser window and some users prefer that.

      You can also try RokDownloads if you're looking for a full application of features, but it is a larger install that might not be necessary for just a couple files.
    • JEM's Avatar
    • JEM
    • Preeminent Rocketeer
    • Posts: 17917
    • Thanks: 4

    Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • :arrowu: +1

      All a matter of choice as to how you organize your PDFs for DL.

      On some sites, where there are many PDFs that can be categorized and placed in a special section using a download component, that may be the way to go.

      If the PDFs are far and few between, or not easily organized, I usually place the PDF file in the folder for the Article and then link it as Ben suggested.

      You can write the link by hand if you like, but I prefer to use JCE to add the links.

      I just copy the path to the PDF from my FTP, paste in JCE, and choose the target (a new window).

      Once the user clicks on the link, the PDF opens in a new window and they have the option to save it.

      (You can link directly to the file, in which case the user will receive a prompt to save the file, but with a PDF, it's nice for it to open first.)
    • Thanks,
      jim
  • Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • I added the pdf to the media manager, then added the link using Ben's instructions and I get the following error message:
      Not Found

      The requested URL /images/stories/pdf_files/aha_moment_brochure.pdf was not found on this server.

      Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
      My website is: ahamomentmarketing.com/
      This image is hidden for guests.
      Please log in or register to see it.
      [attachment=1g46h37a][attachment=1g46h37a]

      Any suggestions?
  • Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • can you upload or move an image into the pdf_files folder & then just try to display the image? This will verify that the path is correct. I'm at a loss to why it doesn't work so try a few things that you know should work and see what happens.
      good luck
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • Hi Brent,

      Can you PM me login info for the admin backend so I can take a look?
  • Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • Hi Ben,

      I sent you the PM this morning.

      Thanks
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • I logged into your site and checked it out and things are working fine with images from that directory and pdf files are allowed in the global configuration. It seems as though the file didn't upload correctly.

      Can you try deleting it and re-uploading it to see if that makes a difference?

      If you have access to FTP, you might want to try uploading the file that way instead.
  • Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • For some reason after uploading it via FTP a few times it worked.

      Thanks!
    • Ben Lee's Avatar
    • Ben Lee
    • Elite Rocketeer
    • Posts: 4193
    • Thanks: 42

    Re: Is there a module that allows users to download a PDF file?

    Posted 14 years 7 months ago
    • Glad you got it working!

      Just FYI, it's best to create new directories in the media manager and then you can upload files to those directories through FTP. When doing this, a blank "index.html" file is created that prevents that directory from being browsed.

      If you're going to create directories in FTP, you'll want to copy one of these index.html files to it so it's protected as well.

      Just browse to the directory, leave the file name off the url, and you should see a blank white page to see what I'm talking about. Without that index.html file there, you'll see a listing of links of the files in that directory.

Time to create page: 0.085 seconds