How can a PHP script be written to act as a proxy for file downloads without saving the file on the server?
To create a PHP script that acts as a proxy for file downloads without saving the file on the server, you can use the `readfile()` function to read the file from the remote server and then output it to the client. This way, the file is not saved on the server's disk but is directly streamed to the user for download.
<?php
$file_url = 'http://example.com/file.zip'; // URL of the file to download
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file_url) . '"');
readfile($file_url);
exit;
?>