• Resolved einstem

    (@einstem)


    Hey there.

    I have a wordpress site and have created a “tips” document in a PDF format that I would like to make available to people that visit my site.

    I use “madmimi” for my newsletter and can set that up with an autoresponder to send a link to a file (they don’t support sending attachments, only links).

    Where would I put the attachment on my account so that someone would be able to click on the link and download the file?

    Should I create some sort of “downloads” directory? Where on my site would I put this?

    Or is there some sort of wordpress plugin that could do something like this for me automaticaly instead?

    Thanks for the help.

    Regards,

    Michael

Viewing 6 replies - 1 through 6 (of 6 total)
  • Upload your pdf file with the media uploader.. Then use the link created to send out.
    The file will be located in you uploads directory

    Hi Michael

    I can’t give you a definitive answer, but I personally tend to create a downloads directory under the web root of my site, give it 644 permissions (typically default anyway) and upload content via FTP to it manually (making sure the file name is all in small caps, and no spaces as unix web servers are case sensitive and dont like spaces eg. download-this-file.pdf). Then when I build my page I just add a link to https://<domain&gt;.com/downloads/download-this-file.pdf

    Pretty basic. I am sure there’s a free plugin out there for doing this, but given how simple that is I haven’t felt the need…

    Hope this helps a little, let me know if you need more clarification on any of the above.

    Best regards,

    Alex

    Thread Starter einstem

    (@einstem)

    Alex,

    Thanks for the response. Sounds pretty simple that what, at least for what I want to do initially. Only downside is that I presume anyone that “finds” this directory can download the file, but I guess they would need to know where to search.

    However, question for you, my filemanager shows my site directory as follows, so where would I put the “downloads” directory:

    Here is the layout of where my site lives in the directory tree on my hosting site:
    /home/public_html/mysitename

    and under my sitename directory, I have directories for:
    /cgi-bin
    /wp-admin
    /wp-content
    /wp-includes

    Would I just create a new directory under /home/public_html/mysitename called:
    /downloads

    And put the file(s) in there?

    Thanks and sorry if this is obvious (newbie here).

    Michael

    Hi Michael – yes – /home/public_html/mysitename/downloads

    I assume you have directory listings off on your web server?

    ie. if you go to https://yoursite.com/downloads/ then it should not list files.

    Also, you should block search engines from indexing this directory (so contents don’t appear in search results). To do this you need a robots.txt file in /home/public_html/mysitename/ with something like:

    User-agent: *
    Disallow: /cgi-bin/
    Disallow: /stats/
    Disallow: /wp-content/backup-db/
    Disallow: /wp-content/upgrade/
    Disallow: /downloads/

    By the way, did you consider gabrielcastillo’s approach? Or did you want to have a separate downloads directory so that search engines wouldn’t display the files (thus hiding them to only people you send a direct URL over email).

    ie. you could have added this to the robots.txt

    Disallow: /wordpress/wp-content/uploads/

    Which is where WP uploads media files, but then all your media would have been blocked – and search engines such as google wouldn’t be able to render pages properly which may cause SEO/ranking issues.

    Thread Starter einstem

    (@einstem)

    Thanks – I created a separate /downloads directory under my root and then created a robots.txt file as suggested above that excludes that directory (as well as some of the additional ones recommended above).

    I could probably have used dropbox as well, but this was very simple to do.

    Michael

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to send a link to a file on my site’ is closed to new replies.