Last active
August 29, 2015 13:56
-
-
Save fedir/8824920 to your computer and use it in GitHub Desktop.
Get file size behind download link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request; | |
request = $.ajax({ | |
type: "HEAD", | |
url: $("#url").val(), | |
success: function () { | |
alert("Size is " + request.getResponseHeader("Content-Length")); | |
} | |
}); | |
// Res.: http://stackoverflow.com/a/1440804/634275 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment