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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:14:10+00:00 2026-05-14T19:14:10+00:00

Well, the question is not intended to be that big. Let me explain the

  • 0

Well, the question is not intended to be that big. Let me explain the scenario: I have two http servers. server A is accessible to end user by web browser, while server B is internal server which can only be accessed by server A. If server B generate some big jpeg image in local disk, and server A has no way to access server B’s filesystem directly, how to let end user see those image without firstly storing those image data in server A temporarily?

I run PHP on server A and perl on server B, but this should not matter. I need a general pattern for implementing this.

  • 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-14T19:14:11+00:00Added an answer on May 14, 2026 at 7:14 pm

    obviously we can’t just delivery those path to image to server A and eventually to end user.

    I think that’s the only way to go, but you don’t need to physically save the files on server A. In PHP: If server A can talk to server B on filesystem level (i.e. through a network share), server A could fetch the data from server B and pass it through to the user:

    header("Content-type: image/jpeg"); // Make sure you send the right headers
    $file = fopen("/path/to/server/b/huge/image.jpg", "r");
    fpassthru($file);  // or deliver chunks using fread()
    fclose($file);
    

    If there is only an internal http connection, you would change the 2nd line to something like

    $file = fopen("http://serverb.local/huge/image.jpg", "r");
    

    if this method is too slow for you or not convenient to set up, you would have to use (S)FTP, SCP or something similar. FTP is available in PHP natively; the other protocols are probably easiest to simply call from the PHP script using exec().

    depending on your scenario and use frequency, you may want to employ some sort of caching on Server A, so that this operation doesn’t have to be repeated every time.

    If your servers are hosted in a datacenter, make sure that traffic between them is free or not too expensive.

    This is the leanest way I can think of to let the user “see” an image without it clogging Server A.

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

Sidebar

Related Questions

As well as my question Removing MKMapView Annotations causes leaks. I have discovered that
My apologies if my question is not well worded but I seem to have
Well the question title may not be self explanatory, so let me go ahead
Sorry this is not a very well defined question, I am thinking about an
My question is probably not well phrased and it's probably a dupe but here
I'm not sure if I phrased my question as well as I liked to
i have this PHP code, and a DataBase with Question, answer1, answer2, Question_id well,
The question seems pretty well formulated I have a virtual machine which implements only
I'm not sure if I convey the question well enough and I couldn't find
TLDR; this is not a well-phrased question, so you should probably not bother with

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.