Response.TransmitFile() fails with UNC Path


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Response.TransmitFile() fails with UNC Path

  1. #1
    Join Date
    Jan 2007
    Posts
    2

    Response.TransmitFile() fails with UNC Path

    I have problem with Response.TransmitFile.
    1. I try to get the file from the UNC path.
    2. The site is running with Windows authentication.
    3. The UNC share looks like "\\machinename\share\file.txt" and this share
    has the DOMAIN USERS added with full permission.
    4. I tried with impersonte true and false but fails.
    5. The error I get is "Access to the path '\\machinename\share\file.txt' is
    denied"
    6. The code works pefectly when it is a local path.
    7. Both WriteFile and TransmitFile fails.
    9. The Web App is on Windows 2000, SP4 (Framework 1.1) and UNC Share is on
    Windows 2003 SP1
    10.

    What kind of security setting am I missing here?

    Thanks in advance
    Sajid

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    You're probably missing Kerberos, which would enable the delegation of credentials from your web application to a remote resource. See the Delegation section in the following article:

    How To: Use Impersonation and Delegation in ASP.NET 2.0
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

  3. #3
    Join Date
    Jan 2007
    Posts
    2
    Thanks. I will check it out. I think I have to make changes in the AD for that.
    before that, its interesting to see that it actually works when I browse the Web Site from the same machine as Web App (Win 2000)!

    but fails when I browse from outside (say.. win XP). I wonder whast the difference.

  4. #4
    Join Date
    Dec 2003
    Posts
    2,750
    It should work if you're logged in to the machine where the web app is running because you've already been authenticated locally. There is no "double-hop" scenario so credentials can be delegated to a remote resource.

    The scenario would be similar to specifying an account in the web.config file that you wish to authenticate with.
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Similar Threads

  1. How can I map a UNC path to a network drive using API from VB?
    By Filipo Novo Mór in forum VB Classic
    Replies: 3
    Last Post: 02-07-2002, 04:48 AM
  2. Replies: 4
    Last Post: 09-29-2001, 02:18 AM
  3. Replies: 0
    Last Post: 09-28-2001, 12:02 PM
  4. Replies: 2
    Last Post: 06-08-2000, 01:40 PM
  5. Replies: 0
    Last Post: 06-07-2000, 12:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center