Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I click a download button, I get a popup-dialog like this:

enter image description here

If the file is large, I want to download it by wget -c URL.
Right-clicking download button to select Copy Link Location doesn't work.
How to copy the download link to clipboard?

share|improve this question
    
Good question. In many cases, you can cancel the download and you'll be at "if you have trouble with the download, use this direct link". Then you can copy the link and use it for wget. In many cases this is not an option. Lets see. –  Paul May 21 '12 at 5:18
add comment

1 Answer

up vote 2 down vote accepted

It depends on how the download is set up.

With certain downloads, the download is initiated with a form GET/POST. So if you look at the final download button's form action, you'll see the download URL.

In other cases, the download is initiated by a redirect (e.g. a PRG or a JavaScript redirect that receives the download URL via an XHR request), in which case, you can use Firefox's Tamper Data add-on to find the download URL in the HTTP traffic, or you can just right-click on the download in Firefox's download manager and Copy Download Link.

But there are some sites that use a single-use URL, or a cookie containing a single-use token, that prevent multiple download attempts, so capturing the download URL via the HTTP request is useless. In such cases, you need to look at the page source to see where you can capture the download URL before the download is initiated. Often, you can find the download URL and/or security token in the page's JS. Otherwise, it's typically found in the response from an AJAX service that the JS requests. Or, you may have to analyze the JS source and watch specific variables to capture all the download request components without actually triggering the download.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.