Filename from URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hach22
Forum Newbie
Posts: 2
Joined: Sat Jul 28, 2007 10:07 am

Filename from URL

Post by hach22 »

I have a URL like: http://www.abcd.com/12345 that give a download of a file xyz.jpg.
how can I get the string "xyz.jpg" from de http://www.abcd.com/12345
Thank you...
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You can't unless it's written somewhere in the source of the site, in which case you'd need to retrieve the site's contents first.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The filename can be specified in the response headers.
hach22
Forum Newbie
Posts: 2
Joined: Sat Jul 28, 2007 10:07 am

Post by hach22 »

thank you, Resolved
shaitand
Forum Newbie
Posts: 10
Joined: Sun Jul 29, 2007 9:54 am

spammer

Post by shaitand »

you can always spot them
Post Reply