unlink($filename);
This will delete the file.
It needs to be combined with ignore_user_abort()
Docs so that the unlink
is still executed even the user canceled the download.
ignore_user_abort(true);
...
unlink($f);
More Related Contents:
- Comma separated numeric values – PHP CodeIgniter
- Send attachments with PHP Mail()?
- How can I debug exec() problems?
- PDO MySQL: Use PDO::ATTR_EMULATE_PREPARES or not?
- What’s the difference between isset() and array_key_exists()? [duplicate]
- Why I am getting Cannot pass parameter 2 by reference error when I am using bindParam with a constant value?
- Convert Word doc, docx and Excel xls, xlsx to PDF with PHP
- REST API – why use PUT DELETE POST GET?
- How to add custom stock status to products in WooCommerce 4+
- Codeigniter: Passing data from controller to view
- CakePHP 2.0 – How to make custom error pages?
- Why does the Laravel API return a 419 status code on POST and PUT methods?
- How to sort date array in php?
- Passing an array using an HTML form hidden element
- writing exif data in php
- Finding the PHP File (at run time) where a Class was Defined
- Why and how do you use anonymous functions in PHP?
- How to check if a request if coming from the same server or different server?
- Function to return only alpha-numeric characters from string?
- preg_match special characters
- Hide variation info from cart item title in WooCommerce 3+
- Why should I use $_GET and $_POST instead of $_REQUEST? [duplicate]
- $_POST Array from html form
- Print $_POST variable name along with value
- How to separate letters and digits from a string in php
- How to execute a stored procedure in php using sqlsrv and “?” style parameters
- utf8_(en|de)code removed from php7?
- MYSQL select a piece of a string and order by that piece
- Getting data from post array in CodeIgniter
- Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2