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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:13:45+00:00 2026-06-09T08:13:45+00:00

Is it possible to force file download to user’s browser (with the standard dialog

  • 0

Is it possible to force file download to user’s browser (with the standard dialog prompt of course)? To be triggered by the server. Basically I’m thinking of pushing a file to the browser coming from server filesystem. Or is this not possible because of security sandbox?
If this is not possible, is there a different way very close to this? I do not want to send the file w/o the user’s consent. I can think of two step approach, first to prompt user of incoming data, and let user click on an OK button which triggers download, but near the end of download, user will get another confirmation box (the standard download prompt which asks to open or save). It would be nice if its possible with one step.

  • 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-09T08:13:49+00:00Added an answer on June 9, 2026 at 8:13 am

    Use an ajax json script that polls the server every 5 seconds or 10 seconds,
    when the server has a file ready responds with a positive answer “I have a file” have an iframe move to that url where the file is, and then it’s handled as a normal download.

    I have provided a little example of how I should think that it should work, so you have something to work from. I haven’t checked it for bugs though, it’s more a proof of concept thing.

    jQuery example(without json):

    $.ajax('/myserverscript.php?fileready=needtoknow').done(function(data) 
        {
        if(data.indexOf("I have a file") != -1)
            {
            xdata = data.split('\n');
            data = xdata[1];
            document.getElementById('myiframe').location.href = data;
            }
        });
    

    PHP code

    $x = filecheckingfunction();// returns false if none, returns url if there is a file
    if($x !== false)
        {
        echo 'I have a file\n';
        echo $x;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Is it possible to initiate a download prompt in the browser for
Is it possible to have PHP download a file from a remote server and
Is it possible to force the iPhone to shutdown ( programmatically , of course)?
I'm wondering if it is possible to force an Open/Save dialog for an inline
Possible Duplicate: Javascript force open a link in a browser I am working on
Is it possible to prevent user from writing letters to a textbox (i.e. force
I'm using an <input type=file /> as a file browser dialog in MVC. I
What I am trying to implement is force download of a file through PHP.
Is it possible to force my C# solution file to make a single DLL
Is it possible to force a rename os.rename to overwrite another file if it

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.