Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:36:12+00:00 2026-06-08T00:36:12+00:00

I have a PHP application running on a Micrisoft IIS 7 server. The application

  • 0

I have a PHP application running on a Micrisoft IIS 7 server. The application shows PDF files on an iFrame, which contains user’s sensitive data that I wouldn’t like to be directly accessed by anyone that knows the file address.

So basically, I’m looking for a way to protect files from direct browser access or download, but still be able to show it on the application’s iFrame.

I made some research with Rewrite rules, but since the “HTTP_REFERER” of an iFrame is empty, I couldn’t find a good solution

Any suggestions for this?
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:36:13+00:00Added an answer on June 8, 2026 at 12:36 am

    Without seeing any of your code, or how your application works, I can only give suggestions based on how I think your app works.

    Rather than showing the files themselves, with links directly to those files, you should consider changing your application so that the PHP reads in the directory, displays the file names (however you want them to appear), with links that go to a download.php page. The download page (after checking whether the user has permission to download the file) then loads the file into memory and serves it out as a response (with appropriate Content-Disposition and Content-Type headers).

    Since your PHP application can read files directly within the web directory, you can set up rewrite rules to prevent accessing those files from the web; that way, the files can only be accessed by the PHP application, which doesn’t rely on rewrite rules to access the drive.

    This is how places like Source Forge can display an advertisement with a countdown that your file download will begin in 5 seconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP web application running on IIS, which allows a user to
I have a PHP application running in iFrame mode. I am rendering an <fb:multi-friend-selector
I have a instance of Apache and IIS running on my server which i
I have a Php application running on my Server A that consumes a .NET
I have a wordpress based php application running on apache on ubuntu server. I
I have a PHP application which I have running on Amazon's Web Services. It's
I am using Google GeoCoding services. I have a PHP application which calls the
I have deployed a PHP application on my tomcat server(Tomcat 6.0).Previously I was using
I have a php application running on XAMPP but I want to connect to
I have a really puzzling problem: I am writing a PHP CLI application running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.