WEB Prevent downloading from file url help.

Discussion in 'OT Technology' started by brds, Feb 12, 2010.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,637
    Likes Received:
    12
    Location:
    Atlanta
    I'm creating a check-in/check-out file editor for my boss and i ran into a little problem.

    Once a file is uploaded, it's "in/out" status would be set to "in".

    From there, a user can check it out to make changes. while it's "out" nobody else should be able to download the file until the first user checks it back in.

    How do I prevent users from downloading the file when it's checked out? I know how to display that it's checked out and not hyperlink the file name to the actual file, but what's to keep a user from remembering the file is located at "www.website.com/files/file1.doc" and just typing that into the url?

    I guess that's really my question... how do i make sure that the user is trying to download via my method, and not just entering the location of the file into their browser.


    I'm using coldfusion 7.0 if that matters (i know, i know CF:mb:)
     
  2. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
    whys it matter
     
  3. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,637
    Likes Received:
    12
    Location:
    Atlanta
    because i dont want the users to be able to get the document by entering in the direct url to the file. I want to force them to go through the application
     
  4. Mikenotmike

    Mikenotmike

    Joined:
    Jun 1, 2001
    Messages:
    6,244
    Likes Received:
    0
    Location:
    USA
    maybe have it temporarily rename it while it's being edited and then renamed back when it's saved
     
  5. ge0

    ge0 New Member

    Joined:
    Oct 31, 2005
    Messages:
    8,398
    Likes Received:
    0
    Location:
    JERSEY
    Or just block referrals ( .htaccess ) for that directory and redirect them.
     
  6. 2ofdem

    2ofdem OT Supporter

    Joined:
    Jun 17, 2003
    Messages:
    114,853
    Likes Received:
    8
    Location:
    aus.vic.mel
    .htaccess would be the way id do it.
     
  7. bomber

    bomber Go Balls Deep

    Joined:
    Jul 14, 2006
    Messages:
    108
    Likes Received:
    0
    Location:
    Philadelphia
    Fetch the file using the cfcontent tag and wrap it in an if statement that checks if the file is checked in or not. This way the files can be outside the root of the site and only accessible when you want them to be.
     

Share This Page