/    Sign up×
Community /Pin to ProfileBookmark

Website Address (pdf File) find out large the download is

I all, really hope someone can help. Never used PHP before and below I have script to increase a web address and list them in a html document. I am creating 20000 web addresses and most of them are duff. Is there away of displaying the size of the download without clicking onto them? Maybe display the size next to the link?

code:

<script type=”text/javascript”>
function showLinks(links){
document.getElementById(“links”).innerHTML = links;
}

//This function actually makes the link list show.
function showLinks(links){
document.getElementById(“links”).innerHTML = links;
}
//This is the function for building the list
function buildList(){
//This is what we use to determine where the loop will start
var start = 1;
//This is what we use to determine where the loop will start
var end = 10;
//This Sets the variable so the += will work inside the ‘While’ function
var links = ”;
//This basically says ‘Does start = end? If not, add another link
while(start <= end){
//This builds the link list, feel free to edit it so it matches your needs
links += ‘<a href=”http://www.address.com/?id=’+start+'” target=”_blank”>http://www.address.com/?id=’+start+'</a><br />’;
/*This checks to see if the list is done being built. If it is, it will call the function that shows the link list*/
if(start==end)showLinks(links);
//This simply adds 1 to the start variable
start++;
}
}

</script>
<body onload=”buildList()”>
<div id=”links”></div>
</body>

Many Regards Andy

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@andymeesonauthorMar 04.2012 — How would I write one of those into my script?

Regards Andy
Copy linkTweet thisAlerts:
@spufiMar 04.2012 — In terms of your JavaScript? You don't. It's PHP so it's a server side script. You should be able to use PHP for what you want, but JavaScript can also get the size of a file.

http://www.kavoir.com/2009/01/check-for-file-size-with-javascript-before-uploading.html
×

Success!

Help @andymeeson spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...