look if file exists on webserver

Skywalker

Member
Joined
Apr 15, 2003
Messages
8
I am having a litle problem with searching on an other machine. I made an search engine form my movies, it search if the file exists on my machine. But I also want to have my friends have a look at my movies so that means they must can see if the file is on my machine. I am running an IIS webserver. Searching localy is no problem but when i want to search from an other location it doesnt work. Does enybody has a klew how to do this? I Searched the holl web form some usefull information, but until now i still didnt find enything!!

Code:
Dim File As System.IO.File 
Dim Search As String 
Dim Search2 As String 
Search = Me.TextBox8.Text 
Search2 = ("C:Movie\" + Search + ".txt") 
Search2 = ("http://213.93.123.204:80/" + Search + ".txt") 
Search2 = CStr(Search2) 
If File.Exists("C:Movie\" + Search + ".txt") Then 
If File.Exists("http://213.93.123.204:80/" + Search + ".txt") Then 
Dim stream_reader As New IO.StreamReader(Search2) 
Me.RichTextBox1.Text = "" 
MessageBox.Show("File found.") 
Me.RichTextBox1.Text = stream_reader.ReadToEnd() 
Me.RichTextBox1.Select(0, 0) 
stream_reader.Close() 
Else 
Me.RichTextBox1.Text = "Movie not found" 
MessageBox.Show("File not found.") 
End If
 
What errors are you getting? It could be something with access premissions to your computer, you might have to configure IIS.
 
If youre talking about the commented out lines, then its likely because youre trying to pass a url to the Exists method that is expecting a path. I *think* youd need to use WebRequest if its a url and File.Exists if its a local or network path.
 
Back
Top