473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to tell if a URL contains a file name?

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
Nov 7 '07 #1
3 1674
Amil wrote:
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

--
Göran Andersson
_____
http://www.guffa.com
Nov 7 '07 #2
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

"Göran Andersson" <gu***@guffa.comwrote in message
news:uV**************@TK2MSFTNGP03.phx.gbl...
Amil wrote:
>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

--
Göran Andersson
_____
http://www.guffa.com

Nov 7 '07 #3
Amil wrote:
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")

--
Göran Andersson
_____
http://www.guffa.com
Nov 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ringo | last post by:
I've come accross an interesting problem populating an asp.net datagrid. I am trying to bind XML data to a datagrid as I've done in countless other applications, the only difference this time being...
19
by: Alan Silver | last post by:
Hello, I have been developing ASP.NET with a text editor so far (better way to learn initially), and have now been trying Visual Web Developer. I want to create a project for an existing site...
10
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All...
13
by: nigel.t | last post by:
Using linux <?php exec("/bin/tar -cvzf myfile.tgz /home/",$arrayout,$returnval); ?> or perhaps try it on your system and tell me if it does/doesnt and what your linux is? I've also tried
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.