0

can someone help me find the best and easiest method to transfer a file/image from a server in php to a client pc, it needs to download/transfer the file to the clients computer when the function is executed this is the function i need it in:

<?php
function download($content){
file_put_contents('./img/meme-temp.png', file_get_contents($content));
`code to download file`
unlink('./img/meme-temp.png');
}
?>

it needs to be in either html, javascript or php i have tried varius methods including using the html download property and javascript autoclick on outputted downloadlinks

  • 1
    https://stackoverflow.com/questions/7263923/how-to-force-file-download-with-php – ADyson Jun 17 '20 at 15:41
  • Does this answer your question? [How to force file download with PHP](https://stackoverflow.com/questions/7263923/how-to-force-file-download-with-php) – Matt Raines Jun 17 '20 at 16:20

0 Answers0