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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:37:46+00:00 2026-06-13T01:37:46+00:00

Question Is it possible to stream an uploading file over PHP, so that an

  • 0

Question

Is it possible to stream an uploading file over PHP, so that an other client can download it while the first one is uploading?

I don’t want to save the file permanently on the server. How can I do that?

Why PHP?

The downloading client shouldn’t need an additional software to get the stream. I thought the easiest way would be the webbrowser.

  • 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-13T01:37:47+00:00Added an answer on June 13, 2026 at 1:37 am

    It’s possible, but the implementation is going to be rather awkward. The main obstacle is that the handling of multipart POST request is hardcoded into PHP. It will always save the files to temporary locations before invoking your script. One workaround is to set up PHP-CLI as a CGI script. As the CLI version of PHP is not HTTP-aware, it lets you get your hands on the incoming data.

    The .CGI file will look something like this:

    #!/usr/local/src/php-4.3.4/sapi/cli/php
    <?php
    
    // populate $_GET
    parse_str($_ENV['QUERY_STRING'], $_GET);
    
    // get the session id from the cookie
    parse_str($_ENV['HTTP_COOKIE'], $_COOKIE);
    $session_name = ini_get("session.name");
    $session_id = $_COOKIE[$session_name];
    
    // get the length of the request body
    $length = (int) $_ENV['CONTENT_LENGTH'];
    
    // read the POST data
    $stdin = fopen("php://stdin", "rb");
    
    while($chunk = fread($stdin, 4096)) {
        [...]
    }
    
    ?>
    

    Parsing the RFC1867 request is non-trivial. Coordinating the uploading party with the downloading party will also be rather tricky, I imagine.

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

Sidebar

Related Questions

Possible stupid question: let's say I have two apps contained within one project. Can
Question Is it possible to stop a Message Driven Bean (programmatically), so that it
Question: Is is possible, with regex, to match a word that contains the same
Question: Is it possible to compile a program on linux using a .dll file?
THE QUESTION Is it possible to run one tab from a different Activity or
I know that streaming flv with php is possible, there are libraries out there
I've just seen this question , where one of the answers indicates that System.Diagnostics.Stopwatch
Question: Is it possible to use php://memory on a exec or passthru command? I
In my previous question, someone has commented that write a .NET Stream to two
My question is about writing a video file to the hard drive that is

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.