locked
Check file download status using client side code like Javascript/JQuery RRS feed

  • Question

  • User683155186 posted

    <div>User click on the button on the webpage to download the file, i want to track the file is being downloaded to the user machine or not using client side code like javascript/JQuery.</div>

    On button click, ASP.NET .ASHX Web handler code is called which return the file to be downloaded.

     <div>Also can we check using javascript/JQuery whether the user is having issue (security, firewall etc.) in downloading the file, when user click on the download button on the webpage.</div>

    Thursday, August 27, 2020 5:18 AM

All replies

  • User-474980206 posted

    There is no client side tracking available. You can make an Ajax call to the server to see if it received an error, but because of buffering, the server might not review an error.

    you should use a unique Id when requesting the download, the client can then use Ajax to poll if the download was sent without error. You can only know when the server competed download, not if it was successfully saved. Say the user hit cancel on the save dialog, or the download folder was full.

    Thursday, August 27, 2020 4:59 PM