php - How to prevent outsiders from downloading a private pdf? -


I am outputting the pdf file with some sensitive information above the public route. I thought I was smart by outputting the file above the public route, but then I realized that anyone can use the public recovery page.

I am using the code below to retrieve the document. How can I ensure that only our people can access the file by accessing the Recovery Document?

  & lt ;? Php // get $ thefile = "" file from the above webtrot $ _GET ["fblah"] "_" $ _GET ["elblah"] ".pdf"; $ RootDir = realpath ('/ var /.../private /'); $ Fulltext = real path ($ rootdair. '/'. $ Thefile); Header ('content-type: application / pdf'); Header ('content-dispute: attachment; filename =' .bessname ($ full text)); Header ('content-length:'. File size ($ full text)); @readfile ($ fullpath); ? & Gt;  

Should a password be verified in the Recovery Page Help?


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -