Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Limit File Downloads

    I'm now continuing a PHP project I was working on over the past week. Now I need a little more help. The script that I wrote creates a text file in a randomly named directory within another previously specified directory. My new objective is to delete the text file after the end-user has downloaded it. I'm not sure how I could go about doing this. I know there are some file hosting services (such as YouSendIt) that offer a limited number of downloads per file. Once that limit has been reached, the file is no longer available to download.

    Is there some way that I could "auto delete" this file? Or even set it to not be able to be downloaded more than one time?

    Thanks in advance for your help.



    -PutterPlace

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yea, an easy method is the user and an ID I would assume yes? Well when they purchase it or w/e, add it to a row in the db with that users ID and location. Then when that ID downloads that file at that location, delete it

    EDIT: Obviously only allow access for that ID

  • #3
    New Coder
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    But that would require me to delete it later on. I was just looking for a simpler way of it deleting itself, or even renaming itself so that it can be downloaded again with the link they are given, then I can delete them later.

    The purpose of this is for a security precaution. The script is used for an account list conversion type thing. I want these people to have a safe feeling knowing that I won't be copying their personal account information.

    I know I won't copy their information, but sometimes people are skeptical when it comes to these kinds of things. Which may lead them away from the service that I'm providing just because of that.


  •  

    Posting Permissions

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