How to tell if a URL contains a file name?

  • Thread starter Thread starter Amil
  • Start date Start date
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
 
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
 
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
 
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")
 
Back
Top