views:

39

answers:

1

A URL redirects to another link. How do I know which link it gets redirected to with PHP and JS? And is finding the filesize of the new link possible too, without complete transfer of the file? Thanks in advance.

A: 

the redirect is either a header or a meta tag. if it's a header, great; if it's a meta tag, you're screwed without a parser.

as for the file size, that might be in the header of the new file, but not necessarily.

you need to clarify your question. what exactly do you want?

sreservoir
It's a "HTTP/1.1 303 See Other".Copied from Live HTTP Headers and pasted here: http://pastebin.com/4QJR74VK
Thanks for your help.
Content-Length: 1120955
sreservoir
ya, got it from Live HTTP Headers but how do i get it from either JS or PHP?
fetch it and read up to \n\n. if it's there, take it. if not, no information.
sreservoir
how do i fetch it with PHP and JS, that's where I am stuck