PHP Guru

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #1

    PHP Guru

    How do you delete a file once it has been downloaded ?

    I don't want to store the name of the file in a list and have a other script deleting the file every hour. I want to delete the file as soon as the download is done. How can I do this ?
    I have nothing to advertise ... yet.
  • nolaman
    Confirmed User
    • Mar 2004
    • 1001

    #2
    unlink("$filename");
    PHP Programmer ICQ 215-504-788

    Comment

    • nakki
      Confirmed User
      • May 2001
      • 137

      #3
      What's up with the quotes around the variable name?
      - adult blog aggregator - sign up here
      NastyLittle.com - trade with an established adult blog

      Comment

      • qw12er
        Confirmed User
        • Apr 2004
        • 799

        #4
        You miss understound my question ... I know how to unlink a file... there is just no event called on download completion...

        I don't know where to call the unlink function
        I have nothing to advertise ... yet.

        Comment

        • woj
          <&(©¿©)&>
          • Jul 2002
          • 47882

          #5
          why not just print out the the content of the file, then delete it?
          Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
          Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
          Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager

          Comment

          • qw12er
            Confirmed User
            • Apr 2004
            • 799

            #6
            hummm seems like an interresting idea ... but how do you print out the content of a file to start a download ?
            I have nothing to advertise ... yet.

            Comment

            • Serge Litehead
              Confirmed User
              • Dec 2002
              • 5190

              #7
              usually move_uploaded_file() work for me when working with file uploads

              another way of doing it, if unlink doesnt do it for you, is to delete file through shell access, look in to shell_exec() or exec()

              Comment

              Working...