How to tell if a URL contains a file name?

A

Amil

I am using httpwebrequest and httpwebresponse. URLs may or may not contain
a file name:

http://www.domain.com/default.aspx
http://www.domain.com

The second URL may return the content for default.aspx. Is there any method
to figure out the file name returns when the second URL format is used?

I've looked through both the resquest and response objects after the
content, but don't see anything.

Amil
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Amil said:
I am using httpwebrequest and httpwebresponse. URLs may or may not contain
a file name:

http://www.domain.com/default.aspx
http://www.domain.com

The second URL may return the content for default.aspx. Is there any method
to figure out the file name returns when the second URL format is used?

I've looked through both the resquest and response objects after the
content, but don't see anything.

Amil

HttpWebResponse.ResponseUri
 
A

Amil

Already looked there...it doesn't resolve if the URL did not contain a file
name. I think I can know "IF" a file name was not on the URL. After the
request, is done, if the request URL has an ending slash, it the original
didn't have a file name.

Amil
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

Amil said:
Already looked there...it doesn't resolve if the URL did not contain a file
name. I think I can know "IF" a file name was not on the URL. After the
request, is done, if the request URL has an ending slash, it the original
didn't have a file name.

Ok, have a look at:

..GetResponseHeader("CONTENT-LOCATION")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top