Reputation: 41
can anyone help?
I'm newbie here
function getFileSize(url, callback) {
var request = new XMLHttpRequest();
//get only header.
request.open("HEAD", url, true);
request.onreadystatechange = function() {
if (this.readyState == this.DONE) {
callback(parseInt(request.getResponseHeader("Content-Length")));
}
};
request.send();
}
Refused to get unsafe header "Content-Length"
that line gives me an error >> allback(parseInt(request.getResponseHeader("Content-Length"))); in console
can anyone help?
Upvotes: 3
Views: 16860