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 6942543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:02:04+00:00 2026-05-27T13:02:04+00:00

My site uses bookmarklets to gather data from external sites, kinda like Pinterest. I’m

  • 0

My site uses bookmarklets to gather data from external sites, kinda like Pinterest. I’m concerned about security and want to move the images the bookmarklet gathers from the doc root up one level. My script has some hefty security checks in place, but I want to add this as a last line of defense.

How do I access my images within my script? Obviously using ../userimages/id/image.jpg wont work. I’m using Apache.

Thanks!

  • 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-05-27T13:02:05+00:00Added an answer on May 27, 2026 at 1:02 pm

    Proxy the image

    You would use a proxy script to feed the images through like the following example:

    // open the file in a binary mode
    $name = '../userimages/id/image.jpg';
    $fp = fopen($name, 'rb');
    
    // send the right headers
    header("Content-Type: image/png");
    header("Content-Length: " . filesize($name));
    
    // you  may like to set some cache headers here
    
    // dump the picture and stop the script
    fpassthru($fp);
    exit;
    

    This example is from the PHP manuals fpassthru() page. You would save this script somewhere in your servers document root/httpdocs folder.

    “Spoofing” the URL to the image

    The easiest way to give the PHP file the appearance of being an image file to a user/browser is to use Apaches mod_rewrite. Usually I use a URL structure something like this:

    http://www.example.org/image-id/image.png
    

    Where image-id is the unique identifier for that particular image. This way the file has the correct extensions of an image instead of .php.

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

Sidebar

Related Questions

I'm trying to delete all the cookies that my site uses but from reading
Currently I have two sites setup in IIS. Primary Site (Uses HTTPs and requires
My site uses URLs like example.de/user1 or example.de/project33 , which can be rewritten by
Some sites use a separate domain for images the site uses, for example YouTube
I am trying to monitor day-to-day prices from an online catalogue. The site uses
My site uses data uri:s to reduce the number of HTTP requests to my
My web site uses iBox (http://www.enthropia.com/labs/ibox/) to display information that I would like users
What's the best way to go about having dynamic titles when your site uses
My site uses YUI Compressor to minify CSS and it's removing the space preceding
I currently have a site which uses a MySQL 4.x schema, the site uses

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.