Show license agreement before download

509 Views Asked by At

I have to solve the following task for our university homepage:

  • Whenever a pdf is requested the user has to accept a license, which pops up.
  • On Agree the download starts. If not, no download is possible.

I searched through the extensions but did not find any extension doing the job. Maybe you know one...

So I tried to implement my own extension. Taking the strengths of securelinks (Allows access control to files from a configurable directory ... presents a license acceptation prior to download) and naw_securedl ("Secure Download": Apply TYPO3 access rights to ALL file assets (PDFs, TGZs or JPGs etc. - configurable) - protect them from direct access.) I wanted to combine both extensions to have one that:

  1. whenever a pdf file is requested (naw_securedl)
  2. a license is shown and in case of ACCEPT a redirect to the file happens (securelinks).

This task sounds very easy, since I only have to combine both tasks. Anyway, I failed.

How do you solve this problem? Do you know some extension doing the job? Is anyone interested in a cooperation in which we try to create an extension thats doing the job?

Thanks for your help in advance!

1

There are 1 best solutions below

1
On BEST ANSWER

Assuming that all donwloads are stored in one folder, I'd recommend writing your own little extension that replaces every link with a link to an intermediate site, like this:
www.mydomain.com/acceptlicense.html?downloadfile=myhighqualitycontent.pdf.

On the accept license page, users need to check the accept license checkbox, then click a submit button, which leads them to the download page, still carrying the GET parameter: www.mydomain.com/download.html?downloadfile=myhighqualitycontent.pdf.

If not all files are in the same folder, you can replace slashes in the file path with other characters (they need to work in the URL). Or you might need a database table that indexes the files, so you can use IDs for the download files:
www.mydomain.com/acceptlicense.html?downloadfileID=99

If you don't know at all how to write TYPO3 extensions, consider using individual php/html files out of the TYPO3 context.