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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:38:13+00:00 2026-05-14T03:38:13+00:00

I have a functionality where a user is given file to download. It works

  • 0

I have a functionality where a user is given file to download.
It works fine. BUT –

  1. How to know whether user has downloaded a file or cancelled it?
  2. After downloading I wat to redirect current page to another one that is also not happening.

Please let me know if any one of you have any idea about it.
(I am doing it in Joomla)

Regards,
Shahu

  • 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-14T03:38:13+00:00Added an answer on May 14, 2026 at 3:38 am

    It depends a bit on how much trouble you want to go to.

    The only way to know whether they actually downloaded the file is to hook into the act of transmitting the file to the client — so that means either hooking into Joomla or whatever underlying web server you’re using, or making the download go through a PHP page that basically just reads the file from disk and sends it out. Even if you do that, though, all you really know is that the file was requested by the browser and that you satisified the request. You don’t know that the user didn’t throw it away immediately afterward.

    In terms of showing a redirect when they’re done, if you’ve hooked into the process as per the above, you could set a session variable flagging whether the file got downloaded (e.g., after sending the last byte). You could use Ajax to periodically query the status of that session flag, and use JavaScript to do the redirect on the client if the flag came back true.

    If all you need to know is that they started the download, you can do that with a cookie mechanism. When sending back the file, add a cookie to the response. (You might do this by funnelling the download through a PHP file as per the above, or if your web server is highly configurable — Apache could do this, for instance — you could configure it to automatically add the cookie.) Your page waiting to see if they downloaded the file (or at least, started to download it) uses JavaScript to periodically check for the cookie (rather than polling the server), which is less traffic. This question and answer talks about doing that in a (little) bit more detail. I do this in an app where the server is custom-building a large PDF or ZIP for download: I show a “building” div when they request the file, then poll for the cookie, and remove the “building” div when the cookie shows up. In the major browsers, the cookie shows up at exactly the moment the browser shows the box asking whether to save the file to disk or open it, because both are triggered by the response coming back.

    If the above is too much hassle (and for some use cases, I think it probably would be), you can put a JavaScript click event handler on the download link. That would tell you that they clicked the link, but doesn’t really tell you much else.

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

Sidebar

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.