• Resolved cpkeaney

    (@cpkeaney)


    Hello!

    I’ve searched around and have seen some questions similar to the one I’m about to pose, but I have a slightly different question at the end.

    I have a PDF file that I want users of my site to be able to access. I’m generally fine with how the core wordpress functionality works using the “Add Media” button within a post, creating a link to the pdf, and having it display with the browser.

    What I don’t love is the resulting URL of the PDF: https://www.patchofearth.com/wp-content/uploads/2015/12/Patch-of-Earth-2015-Holiday-Gift-Guide.pdf

    So two questions:
    1) Is there a way to change this specific URL to read: https://www.patchofearth.com/something/Patch-of-Earth-2015-Holiday-Gift-Guide.pdf

    I’ve experimented with a few of the download manager plugins, and none of them seem to solve for this.

    2) Is there a set of best practices I should be thinking about here? Again, I’m fine with how the PDF is getting displayed, except for the URL. It doesn’t quite feel right to have the full folder path to where the file is displayed in the URL. Are there any security risks for moving forward without changing the URL?

    Thank you in advance for your time in answering these questions.

    Chris

Viewing 4 replies - 1 through 4 (of 4 total)
  • I don’t like dates in my media folder structure, but I don’t think there’s a real issue other than personal preference.

    If you want complete control, you could upload files via FTP to a folder of your choosing. They won’t be part of the media library if you upload them via FTP.

    Thread Starter cpkeaney

    (@cpkeaney)

    Thank you for responding Marios!

    That makes sense to me. I’m wondering if you know how I might track how many times the file is accessed. I know how to track it through any links I put to the file on my site, but in the event that the direct link is shared, I’m wondering how I might track those ‘direct’ downloads.

    Any chance you’ve come across anything that can help with this?

    The only way I know of to track direct downloads of PDF file is via the log files that are typically captured by a server. Log files record everything unlike JavaScript-based tracking (like Google Analytics) that can only track things when the tracking script is executed e.g. via an HTML page.

    Your first step would be to confirm that such file-based logs exist and where they reside. Then decide how you want to access them.

    Thread Starter cpkeaney

    (@cpkeaney)

    Yep, I basically just did that after I sent my last response (and found an issue with the reports from my host in the process).

    Thanks for confirming, and appreciate you taking the time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PDF File URL and Best Practices Question’ is closed to new replies.