Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Viewing files in a web sub directory

Viewing files in a web sub directory

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lonnie R Thomas
    wrote on last edited by
    #1

    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

    K 1 Reply Last reply
    0
    • L 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

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups