Search Results

Search found 1 results on 1 pages for 'user3742063'.

Page 1/1 | 1 

  • PHP Deleting a file 24 hours after being uploaded

    - by user3742063
    I've made a simple script that allows users to upload html files to a web directory on my server. However, I'd like it so each file is deleted after 24 hours of being on my server. 24 hours for each file, not 24 hours for the entire directory. Here is my code so far... Thank you for your help. :) <?php $target = "users/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target) && ($_FILES["uploaded"]["type"] == "html")) { echo "File: " . $_FILES["uploaded"]["name"] . "<br />"; echo "Type: " . $_FILES["uploaded"]["type"] . "<br />"; echo "Size: " . ($_FILES["uploaded"]["size"] / 1024) . " Kb<br />"; echo "Location: /users/" . $_FILES["uploaded"]["name"]; } else { echo "Sorry, " . $_FILES["uploaded"]["name"] . " is not a valid HTML document. Please try again."; unlink . $_FILES["uploaded"]["name"]; } ?>

    Read the article

1