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
Post a Comment