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. Web Development
  3. ASP.NET
  4. Access a local file from ASP.NET Webcontrol

Access a local file from ASP.NET Webcontrol

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorialquestionannouncement
3 Posts 3 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.
  • D Offline
    D Offline
    Daniel Kirstenpfad
    wrote on last edited by
    #1

    Hello i wrote a Webcontrol that tries to access a Textfile on the local hard drive (C:\news.txt) - but it does not work at all. Can anybody tell me how to get this work ?

    P 1 Reply Last reply
    0
    • D Daniel Kirstenpfad

      Hello i wrote a Webcontrol that tries to access a Textfile on the local hard drive (C:\news.txt) - but it does not work at all. Can anybody tell me how to get this work ?

      P Offline
      P Offline
      Paul Riley
      wrote on last edited by
      #2

      When you say "local hard drive", do you mean that of the web page user or that of the web server? If that of the user, you can't get it to work. There are good security reasons why you can't get it to work. Imagine a web page which could help itself to the hard drive. If the local drive is the web server, all you need to do is give it the absolute path and make sure user ASPNET has permission to access the file. Paul We all will feed the worms and trees
      So don't be shy
      - Queens of the Stone Age, Mosquito Song

      A 1 Reply Last reply
      0
      • P Paul Riley

        When you say "local hard drive", do you mean that of the web page user or that of the web server? If that of the user, you can't get it to work. There are good security reasons why you can't get it to work. Imagine a web page which could help itself to the hard drive. If the local drive is the web server, all you need to do is give it the absolute path and make sure user ASPNET has permission to access the file. Paul We all will feed the worms and trees
        So don't be shy
        - Queens of the Stone Age, Mosquito Song

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        if the site is listed as a trusted site in your internet options you could brows a users hard drive.

        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