Make files available for download on a WP site

10 replies
  • WEB DESIGN
  • |
Hi all

I have a number of wordpress sites that I would like to load pdf files to be available for site visitors to download, such as ebooks.

I have tried uploading a pdf file into my public.html directory and created an href for it but when I click on the link all I get is a 404 page. The file name has for example: important reasons for detoxification.pdf
I created this href to be like this:

<a href="http://sitenamedotcom/importantreasonsfordetoxification.pdf">Important reasons for detoxification</a>

What do I need to change to allow the pdf to open for them to read or save to their computer?

Cheers
Viv
#download #files #make #site
  • Profile picture of the author Abledragon
    I create a specific folder for downloads and upload all files to that.

    I then create the link in Wordpress, but be sure to copy the filename of the file you uploaded, because capitalisation, spelling etc are critical, and paste that into the url you create.

    Best check is to see if you can access the file by simply typing the url into your browser address bar. As soo as you successfully access the file copy that url from your address bar to the link you're creating.

    Cheers,

    Martin.
    Signature
    WealthyDragon - Earning My Living Online
    {{ DiscussionBoard.errors[740253].message }}
  • Profile picture of the author mywebwork
    Hi Viv

    Martin is correct, I suspect that it may be an issue of capitalization. LINUX servers are very sensitive to that.

    A couple of thoughts:

    1 - If these PDF's are for sale, or if you would like to collect e-mail addresses before permitting downloads you could use e-Junkie:

    E-junkie Shopping Cart for selling downloads & tangible goods

    They will collect your users e-mail and send them a temporary download link. They also host the files and integrate with PayPal if you want to sell the e-books. It's really cheap - about 5 US dollars a month (make sure you search the web for coupons, you can always find a 3 or 4 month free coupon for eJunkie somewhere).

    2 - If you are going to host the files yourself I would add a target="_blank" statement to your hyperlink, to open the PDF in a new window on those browsers that are setup to open the file (as opposed to downloading it). That way your main site will still be displayed.

    Bill

    P.S. Got your PM, sorry I haven't answered -been a crazy week with deadlines and all. I will respond to you very shortly, just wanted you to know I wasn't ignoring you!
    {{ DiscussionBoard.errors[740430].message }}
    • Profile picture of the author mistyone
      Hey Martin and Bill

      Thank you both for your useful information.

      I am quietly working away at this and absorbing everything you are telling me

      Bill, I am wanting to do both of those things with the files, so I will investigate using e-Junkie. Thanks for that

      I did wonder about how to make the file open in another window. So I will try and write into the code what you have told me.

      I am always willing to give things a go and I am learning heaps and heaps

      I look forward to hearing from you when you are all caught up Bill, no rush

      Cheers
      Viv
      {{ DiscussionBoard.errors[740535].message }}
  • Profile picture of the author Audrey Harvey
    Viv, Wordpress has the facility to upload media through it's own interface. If you look at the top of the box where you type in the text for a post, there are little icons for "add image", "add video", "add audio" and "add media". You can use the latter to upload your pdf's, then use it's url in your page/post as a download url. Works a treat.

    Cheers

    Audrey
    Signature

    Expert content written by an experienced veterinarian and published magazine and newspaper writer.
    Feel free to contact me for details.
    {{ DiscussionBoard.errors[740659].message }}
  • Profile picture of the author WebScript
    Originally Posted by mistyone View Post

    Hi all

    I have a number of wordpress sites that I would like to load pdf files to be available for site visitors to download, such as ebooks.

    I have tried uploading a pdf file into my public.html directory and created an href for it but when I click on the link all I get is a 404 page. The file name has for example: important reasons for detoxification.pdf
    I created this href to be like this:

    <a href="http://sitenamedotcom/importantreasonsfordetoxification.pdf">Important reasons for detoxification</a>

    What do I need to change to allow the pdf to open for them to read or save to their computer?

    Cheers
    Viv
    Hi Viv,

    I am glad you found a solution that works for you.

    Keep in mind that you also need to be careful of using spaces in the filenames as that could be a cause of some problems too.

    For example, in your original post, you mentioned the filename was:
    "important reasons for detoxification.pdf"

    but when you showed the url, the spaces were omitted
    "hxxp://sitename.com/importantreasonsfordetoxification.pdf"

    this won't work because the filenames are not identical.

    I would avoid using spaces in filenames although you may not always be able to.
    The problem with using spaces in filenames is that although the file is named:
    "important reasons for detoxification.pdf",

    for URL's you need to encode spaces as "%20" which is the "Hexcode" for a space.

    So the file would be accessed in a URL as:
    "hxxp://sitename.com/important%20reasons%20for%20detoxification.pdf"

    To avoid all those issues, you could replace all spaces in the original filename with "-" (dashes). That way, "important-reasons-for-detoxification.pdf" is the same when used as a filename or as a URL.

    Kevin
    {{ DiscussionBoard.errors[741964].message }}
  • Profile picture of the author mistyone
    Hi Kevin

    I did wonder if I had made an error with the file name and href being different so thanks for that clarification. That is why I showed how I had set things up so that if what I had done was incorrect someone would have picked that up and you did so that has helped me a lot, thank you

    Cheers
    Viv
    {{ DiscussionBoard.errors[744128].message }}
  • Profile picture of the author CaffeinatedWorld
    Also if you are using Wordpress there are some great plugins for Sharing files. Simply go to wordpress (dot) org and search the plugin directory.

    Search under:
    Download Manager
    {{ DiscussionBoard.errors[763790].message }}

Trending Topics