Viewing files in a web sub directory
-
I have this code that a friend helped me with. Dim di As New DirectoryInfo(MapPath("~/uploaded/agenda")) Dim fiArr As FileInfo() = di.GetFiles() repeater_agenda.DataSource = fiArr ''loop through briefings directory 'rptdirectory.DataSource = IO.Directory.GetFiles(MapPath("~/resources")) Me.repeater_agenda.DataBind() It will read the directory and list the files in that directory just fine. But when I click on the file I want to read the url comes back - https://wwwmil.4af.afrc.af.mil/resources/AFTP System.doc and I get a page not found error. I am new to this and am totally lost. Could somebody help me pls?
Lonnie R Thomas
-
I have this code that a friend helped me with. Dim di As New DirectoryInfo(MapPath("~/uploaded/agenda")) Dim fiArr As FileInfo() = di.GetFiles() repeater_agenda.DataSource = fiArr ''loop through briefings directory 'rptdirectory.DataSource = IO.Directory.GetFiles(MapPath("~/resources")) Me.repeater_agenda.DataBind() It will read the directory and list the files in that directory just fine. But when I click on the file I want to read the url comes back - https://wwwmil.4af.afrc.af.mil/resources/AFTP System.doc and I get a page not found error. I am new to this and am totally lost. Could somebody help me pls?
Lonnie R Thomas
I am guessing that you need to do a server.urlDecode() This will properly translate all of the escaped characters so that a valid url. Or you may want to change your doc names so they don't have characters in them that need to be escaped. Anyway, that is my guess as to what is wrong. Ben