-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Documentation: Introduction
The StreamOnly Plugin allows the user to upload audio/mpeg files and make them available to the public while protecting them against the most common methods for downloading them. It does this by storing the files in a folder that is not under the root document folder. The files are accessed by executing a PHP script when the browser requests the server to download the file. This could be when the page is loaded (likely on laptops), or it could be when the user taps on the audio controls (likely on mobile devices).
When the plugin (in a callback routine) creates the HTML to display the audio controls, it creates a unique ID, ddddddddd (the number of digits may vary). It uses that ID to create a playlist file ddddddddd.m3u, which contains the absolute path name to the protected file. It then appends the name of that file to the URL of the script, which, when executed, will stream the contents of the file to the browser.
When the script is executed, it reads the contents of the playlist, deletes it, and downloads the contents of the audio file. It precedes the download with header commands requesting that the browser not cache the file. Since the playlist is deleted, the audio file cannot be downloaded again using that URL. This prevents the user from saving a copy of the audio file by the most commonly used methods - the Context Menu (right click) and browser plugins, which either pull it from the cache or attempt to download it again.
Attempts to use the Firefox Context Menu and the "All Downloader Professional" Firefox plugin result in the content of files/m3u/custom_msg.txt to be returned in place of the audio file. (See also Executing the script)