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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:29:29+00:00 2026-06-10T00:29:29+00:00

How to get a download box for the following code. i.e., when user clicks

  • 0

How to get a download box for the following code. i.e., when user clicks on download hyperlink the download window should appear irrespective of the browser type. I have tried the following:

<a href="javascript:void(0);" onclick="download_tagged_file('{{cnt.id}}');">Download</a><
function download_tagged_file(cntid)
{
  var snddata = {};
  snddata["cntid"] = cntid;
  $.post("/tagging/download_tagged_file/", snddata, 
     function callbackHandler(data, textstatus) 
     {
        if (data.status == 1)
        {
            var url = data.filename;
            url = "http://127.0.0.1:8000" + url
           //var htm = '<iframe style="display: none;" id="if1" src="'+url+'"></iframe>';
           //alert(url);
           window.open(url, 'download_window', 'directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');
           window.focus();
 }
  • 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-10T00:29:31+00:00Added an answer on June 10, 2026 at 12:29 am

    I don’t really get what youre trying to do, whats wrong with:

    <a href="http://127.0.0.1:8000/{{cnt.id}}">Download</a>
    

    Update:

    you need to control the content disposition server-side. The above html is what you need, but your server needs to send this header when serving the file:

    Content-Disposition: attachment; filename=<file name.ext> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I'm trying to get an automatic download box to appear when people
I have a dialog box open when a user clicks on a url. In
There is one user who only get a dialogue box and download error when
I start a download using PHP with this code: <? $_REQUEST['file'] = urldecode($_GET['file']); header(Content-type:
I have an anchor tag: <a href="file.pdf">Download Me</a> I would like for the user
I have a chained dropdown box that pieces together a download string from a
I have the following HTML: <span class=open_download_link> <a>Downloads</a> <img src=layout/download.gif/> </span> <div class=download_box> <img
When I download a jQuery-ui theme, what do I have to add to get
I'm using ajax to get what the user has selected in a select box
Why do visitors to my site sometimes get a download to a file instead

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.