SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2004
    Location
    maine
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Allowing file to be downloaded once

    Hello, folks

    I need to write a script that will allow a user to download a file ONCE.

    Is there any way to confirm that the download is complete and then remove the file?

    Or something else?

    I can think of a couple ways to do it, but there are flaws in each way - not huge flaws, but I'd like to find the best solution possible.

    Thank you!

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is no way to do it, with http at least. You can control every byte you send, but you know nothing about what the client received.

    Moreover it seems not to make sense to implement such protection (for some paid contents I guess). You cannot (technically) forbid users to redistibute downloaded files...

  3. #3
    SitePoint Member
    Join Date
    Feb 2004
    Location
    maine
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It has nothing to do with the protection of distrobution.

    Anyone else?

  4. #4
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, here's an ugly way to do it.

    I'm assuming all users are unregistered.

    set the system up with a db:
    table download:
    email (downloaders email address)
    filename
    flag

    Then ask users to input their email addresses for download.

    if email address is already in db & flag is 1, do not let them download and if not, let them download and input their address in db, alongwith filename of file they are dloading and set flag to 1.

    if you do not want to go with email addresses, use IPs, but it's less reliable.

    I put the flag column in the table up there in case you need to let someone who has already downlaoded it once to download again. you just need to flip the flag value to zero.

    hope this helps.
    asT.

  5. #5
    SitePoint Member
    Join Date
    Feb 2004
    Location
    maine
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! That is about what I came up with - just a flag to check if it has been downloaded.

    Only problem I can see is people who get cut off halfway through a download and such...but I don't think there is a way around it?

  6. #6
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, you cant tell if a user has finished downloading the file.


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
  •