find targeted file

Asked By Zeljko Mrcic
29-Aug-10 05:34 PM
Earn up to 0 extra points for answering this tough question.
if I have uri like http://somedomain.com/september/

and its giving me a response, like normal request, like http://somedomain.com/september/septemberdata.hml
how can I find which file is at the end of the uri?

  re: find targeted file

Ken Fitzpatrick replied to Zeljko Mrcic
29-Aug-10 08:34 PM

Not sure I understand, but if you have a the URL in a string, you can use the split function to get the filename out of it.
The following example VB code will strip it out into a variable called filename:

  
'Split the url up by the slash into an array
Dim url_parts() As String = url.Split("/"c)
  
'The filename is the element numbered one less then the array length
Dim filename As String = url_parts(url_parts.Length - 1)

If there are any querystring parameters after the filename, you can remove them with the following code:
Dim filename_parts() As String = filename.Split("?"c)
filename = filename_parts(0)

Hope this helps,

Ken

  re: find targeted file

Super Man replied to Zeljko Mrcic
30-Aug-10 01:00 AM

when you request this http://somedomain.com/september/

if directory listing in enable for normal user then you can see the content of that directory.

but when you use http://somedomain.com/september server uses some mechanism and redirect to 

http://somedomain.com/september/septemberdata.hml

you might see that when you use some site

www.example.com

then it will open www.example.com/defualt.aspx

  re: find targeted file

Zeljko Mrcic replied to Ken Fitzpatrick
30-Aug-10 02:35 AM
No this does not help...you are right...thats the way to read querystring...but...
I have url http://somedomain.com/september and when I run this in browser it gives me some data...but what FILE is at the end of the url, what is the target of that address? Is it sep.html, sep.aspx....or something else?
  re: find targeted file
Goniey N replied to Zeljko Mrcic
30-Aug-10 06:02 AM
Hi, Zeljko Mrcic,

Your Question Is Very Odd. Because It's Not Possible That After "http://somedomain.com/september/" This URL What Will Be There There May Be Many Filenames After This Directory.


//Here Your Given Path Is Nothing But The Directory Path & if That Site Allow You To Access That Directory Then & Then Only You Can Access Otherwise it Will Give You Error..


//But one Way Is That You Can Open The home Page..

In The Address bar Write "http://somedomain.com/september/*.*" & Then Press EnterThen It Will Redirect You To Home Page Directly.....

& In The Address bar It Will Display "http://www.somedomain.com/?dl=1" This URL...


//Hope This Will Helps You....
  re: find targeted file
Zeljko Mrcic replied to Goniey N
31-Aug-10 06:00 AM
*.* at the end sends me to error page...
It seams that I'm not well understood...
if I type "http://somedomain.com/september/" in explorer address, I get, let say page(I don't know extension) saying "Money transfer in September 2010 was 4 USD"
I tough that it was some kind of AJAX, but no xmlhttp requests on page I get(via "view source"), like there is some kind of parser on web server, gathering 'september'  from request, and then generating data from database and sending it back...but there are all kind of pages...they MUST have something like ?PeriodID=1&Year=&....at the end of request....but I can't see that anywhere...even FireBug...
Create New Account