how to force the download of a php file and delete it right away

Asked

Viewed 40 times

0

I made a file with fopen(); and I need it to be downloaded on the user’s computer and deleted right away, and it is necessary that the file name is in a variable, because the file name will vary depending on the user.

  • You can show your code and what doesn’t work?

  • use unlink("directory/filename.ext"); or if it is in the unlink folder("filename.ext");

  • related https://answall.com/questions/114254/download-de-arquivos-em-php

  • attribute download from Html5 https://www.w3schools.com/tags/att_a_download.asp

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.