System.IO.File.Exists Method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?TWlrZQ==?=

    #1

    System.IO.File.Exists Method

    Hi. I'm building a program which allows users to upload files (located both
    on their computer and on our network) onto a file server. However, it
    appears that the Internet Guest Account on the webserver must have access to
    every possible file location from-which the users are selecting files. If
    this access is missing, an exception of type
    System.Unauthor izedAccessExcep tion occurs.

    Obviously its impractical for me to grant the Internet Guest Account access
    for all possible network locations.

    What should I do to workaround this delima? Is there a workaround?

    Thanks!
  • Patrice

    #2
    Re: System.IO.File. Exists Method

    Not sure what you are doing.

    The user selects a file (so the user must have access obviously to the file
    he want to select). Then server side you get the file content and you save
    it were you wish (at a writable place). The server must have write access
    only to this place.

    For now it would look like if you tried to store those files at their
    original location or something similar ?

    ---
    Patrice

    "Mike" <Mike@discussio ns.microsoft.co ma écrit dans le message de news:
    F07F7190-6985-4144-AA79-3B2319BDB6A7@mi crosoft.com...
    Hi. I'm building a program which allows users to upload files (located
    both
    on their computer and on our network) onto a file server. However, it
    appears that the Internet Guest Account on the webserver must have access
    to
    every possible file location from-which the users are selecting files. If
    this access is missing, an exception of type
    System.Unauthor izedAccessExcep tion occurs.
    >
    Obviously its impractical for me to grant the Internet Guest Account
    access
    for all possible network locations.
    >
    What should I do to workaround this delima? Is there a workaround?
    >
    Thanks!

    Comment

    • =?Utf-8?B?TWlrZQ==?=

      #3
      Re: System.IO.File. Exists Method

      Hello Patrice,

      Thanks for your response. It turns out I need to turn "Identify
      Impersonate=On" . Doing this fixed my problem.

      "Patrice" wrote:
      Not sure what you are doing.
      >
      The user selects a file (so the user must have access obviously to the file
      he want to select). Then server side you get the file content and you save
      it were you wish (at a writable place). The server must have write access
      only to this place.
      >
      For now it would look like if you tried to store those files at their
      original location or something similar ?
      >
      ---
      Patrice
      >
      "Mike" <Mike@discussio ns.microsoft.co ma écrit dans le message de news:
      F07F7190-6985-4144-AA79-3B2319BDB6A7@mi crosoft.com...
      Hi. I'm building a program which allows users to upload files (located
      both
      on their computer and on our network) onto a file server. However, it
      appears that the Internet Guest Account on the webserver must have access
      to
      every possible file location from-which the users are selecting files. If
      this access is missing, an exception of type
      System.Unauthor izedAccessExcep tion occurs.

      Obviously its impractical for me to grant the Internet Guest Account
      access
      for all possible network locations.

      What should I do to workaround this delima? Is there a workaround?

      Thanks!
      >
      >
      >

      Comment

      • VJ

        #4
        Re: System.IO.File. Exists Method

        I think I know what Mike says.. the upload location is different each time,
        and how to manage it you are saying... here is a idea..

        Upload only to a certain location ( granted writes)
        the remote machine runs a localized and authorized process that can move the
        file on receive. Of course this process should be listening to receive files

        HTH
        VJ

        "Patrice" <http://www.chez.com/scribe/wrote in message
        news:%23kUnCL%2 3aHHA.588@TK2MS FTNGP06.phx.gbl ...
        Not sure what you are doing.
        >
        The user selects a file (so the user must have access obviously to the
        file he want to select). Then server side you get the file content and you
        save it were you wish (at a writable place). The server must have write
        access only to this place.
        >
        For now it would look like if you tried to store those files at their
        original location or something similar ?
        >
        ---
        Patrice
        >
        "Mike" <Mike@discussio ns.microsoft.co ma écrit dans le message de news:
        F07F7190-6985-4144-AA79-3B2319BDB6A7@mi crosoft.com...
        >Hi. I'm building a program which allows users to upload files (located
        >both
        >on their computer and on our network) onto a file server. However, it
        >appears that the Internet Guest Account on the webserver must have access
        >to
        >every possible file location from-which the users are selecting files.
        >If
        >this access is missing, an exception of type
        >System.Unautho rizedAccessExce ption occurs.
        >>
        >Obviously its impractical for me to grant the Internet Guest Account
        >access
        >for all possible network locations.
        >>
        >What should I do to workaround this delima? Is there a workaround?
        >>
        >Thanks!
        >
        >

        Comment

        • Patrice

          #5
          Re: System.IO.File. Exists Method

          Still look really weird. The server doesn't even access to "every possible
          file location from which users are selecting files". Usually the user select
          a file. The content is read by the browser (i.e. a client side program) and
          sent to a server page that then reads the content (the server doesn't read
          from the original location, it just reads what the browser sent).

          Glad you solved the problem but you may want to explain what you are doing
          as the behavior you have doesn't match the usual upload scheme and would let
          me suspect some design problem.

          Are you sure this is not a problem when you write the file server side
          rather than when you read (how ?) the file in which case impersonation could
          be overkill (you could have just granted the needed rights to the storage
          location)...

          ---
          Patrice

          "Mike" <Mike@discussio ns.microsoft.co ma écrit dans le message de news:
          EB4B4D4B-4DF6-47B9-94A1-0759EAFE78C7@mi crosoft.com...
          Hello Patrice,
          >
          Thanks for your response. It turns out I need to turn "Identify
          Impersonate=On" . Doing this fixed my problem.
          >
          "Patrice" wrote:
          >
          >Not sure what you are doing.
          >>
          >The user selects a file (so the user must have access obviously to the
          >file
          >he want to select). Then server side you get the file content and you
          >save
          >it were you wish (at a writable place). The server must have write access
          >only to this place.
          >>
          >For now it would look like if you tried to store those files at their
          >original location or something similar ?
          >>
          >---
          >Patrice
          >>
          >"Mike" <Mike@discussio ns.microsoft.co ma écrit dans le message de news:
          >F07F7190-6985-4144-AA79-3B2319BDB6A7@mi crosoft.com...
          Hi. I'm building a program which allows users to upload files (located
          both
          on their computer and on our network) onto a file server. However, it
          appears that the Internet Guest Account on the webserver must have
          access
          to
          every possible file location from-which the users are selecting files.
          If
          this access is missing, an exception of type
          System.Unauthor izedAccessExcep tion occurs.
          >
          Obviously its impractical for me to grant the Internet Guest Account
          access
          for all possible network locations.
          >
          What should I do to workaround this delima? Is there a workaround?
          >
          Thanks!
          >>
          >>
          >>

          Comment

          Working...