用户受限文件访问

I need to make a restricted file access system in php (I use Wordpress for my site).

Here is my idea:

  1. User creates file via a pdf generator
  2. Save this file in a specific folder (with a ID)
  3. Denie the access for everybody - including the user who generated the file
  4. Check on a output.php file if the user is the same who generated the file
  5. Give the user the link for the file

The thing is that the file should be just downloadeble from the output.php and not via url in browser or something else. I know that sound unimpossible but is there everybody who has an idea? Although with restrictions if all is not possible.

Thank you very much for your help :)