How to Download File using jQuery?

AuthorSumit Dey Sarkar

Pubish Date27 Nov 2022


In this tutorial we will learn how to download file using jQuery?

Here we will use window.location to download any file or image using jQuery.


Let's see an example -


How to download file using jQuery?

<!DOCTYPE html>
    <title>How to Download File using jQuery?</title>
    <h1>How to Download File using JQuery?</h1>
    <a class="downloadUsingJquery" href="#">Download Now</a>
<script src=""></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".downloadUsingJquery").click(function (e) {
            window.location.href = "";
Comments 0

Leave a comment