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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:01:28+00:00 2026-05-17T16:01:28+00:00

I know how to display output to a web browser (obviously) and I also

  • 0

I know how to display output to a web browser (obviously) and I also know how to push a file for the client to download by setting the Content-Disposition and Content-Type headers and then pushing the file data. But I want to do both, similar to how many download pages work (“your file download will begin momentarily”).

What technique is used to accomplish that? I was thinking about using a META HTTP refresh, but here’s the thing… The web page is actually doing some fairly complex processing and I want to display the results of the processing to the user and push the results in file form to the user but only perform the processing once. I would like to avoid the HTTP refresh if possible. Is there any way to accomplish both of these with a single page request? Or am I going to have to write the file to the server and then serve it up on the second page request from the HTTP Refresh request?

  • 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-17T16:01:28+00:00Added an answer on May 17, 2026 at 4:01 pm

    Use an iframe in your output that will have a link to the file you want to download.

    Output sample:

    <div>Foo</div>
    <iframe width="0px" height="0px" src="path/to/file"></iframe>
    

    You cannot say “this part if for display and that one is for download” with the HTTP protocol.

    However, you can “cache” the file in a temp directory, one that is inaccessible from the public view (outside the document root) and then output that document content through PHP (ex: file_get_contents or something). That temp folder can then be cleaned by an API that could simply scan that folder and delete any file older than a certain time (see filemtime())

    This cleanup can be done every time a new file is created, thus keeping the size of the folder at a reasonable value.

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

Sidebar

Related Questions

Jnews Display list Content: http://i204.photobucket.com/albums/bb267/kellyshl/Untitled.png i wan to know how to make it like
Does anyone know the display formatter that I would need to add to the
Does anyone know how to display a percentage format based on the locale using
I would like to know how to display orders placed on a certain day.
I know that the reminder application should display a badge or sound or kind
I won't know how much text will be given to display, and the JTextAreas
I want to know if there is a way to display an external php
i want to know how to remove underline in display listview in android, can
Does anybody know if there is a way to display the text value of
Does anyone know of a way to make an AIR app display over top

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.