SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    protect electronic files sold on a website

    How do you set up a directory of videos that can only be accessed from a certain url?

    Thanks

  2. #2
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,417
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    One way is to store them above the root directory, and use a small script to generate a dynamc link to the appropriate file.

  3. #3
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That's interesting. How does an HTML page link to something above the root directory to deliver the content?

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    HTML can't link to above the root directory. You have to use a server side script to read the file from there into the script and have the script in the folder where you want the file accessible from.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Can you elaborate please? So if there were a member area and after logging in you could play videos through a flash player. How would the video file be accessed?

    Many Thanks

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Instead of referencing the flash file directly from the page you instead reference a server side script. That script validates that it has been accessed in a way where the flash file is allowed to be displayed and if it has it then sets up the appropriate headers to identify that it is a flash file and it then reads the content of the flash file into itself.

    So your server side script basically contains three pieces of code.
    1. validate that the file has been requested from somewhere that is allowed
    2. set the headers to identify this file as containing flash and pass that to the browser.
    3. copy the content of the flash file from above the root folder and pass it to the browser.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    SitePoint Guru
    Join Date
    Jan 2007
    Posts
    971
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for this info. Will this work if the file needs to be embedded on the page. Typically there is one Flash Player which is not protected that references a video file that is.
    Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •