A
A
Alexey Nikolaev2016-02-18 15:33:34
CMS
Alexey Nikolaev, 2016-02-18 15:33:34

Are there plugins that allow you to encrypt attachment links?

Good afternoon!
I am unsuccessfully looking for a plugin that would allow me to convert direct links to a file from the WP library into some unique hash that is only available within the session. So far, I have only found a large and complex framework (S2 Member Framework) with a lot of features.
Are there alternatives?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2016-02-18
@Stalker_RED

the problem is non-trivial.

What is non-trivial in it? Just two small functions.
Before displaying the link in the browser, we generate some random identifier (for example, a hash from the file name + session identifier + salt).
We write this hash into the session as a key, and the original path to the file as a value. We display the link like this: "/myFileloader.php?hash=1SD3F5G..."
And we make a function that returns these files: We look
for this hash in the session, if there is a path to the file, we output it to the browser. If not, we show 404.
That's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question