Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Writing Files to Mapped Drive

  1. #11
    Join Date
    Jun 2003
    Posts
    277
    Rep Power
    0

    Default

    You need to change the IIS Anonymous user to a Power user with rights to the folder in question.

    That should do it.

    If the Mapped folder is on a different server then the IIS Anon. User should be a domain user with rights
    to the detsination folder
    Contrary...Very Contrary!

  2. #12
    Join Date
    May 2007
    Posts
    1,527
    Rep Power
    0

    Default

    try this vid its low in quality but it explain all you need to know

    it help me out a bit, hope it help you too

    http://www.youtube.com/watch?v=gcpiF...eature=related
    I Now Have the Highest OC on Techja 4.2Ghz
    GekkoState™:Gigabyte X58 Extreme | Intel Core i7 940 OC @ 3.08Ghz cooled by Noctua NH-U12P SE1366 | Corsair Dominator DDR3 -6x2Gig |2 EVGA E-GEFORCE GTX 260 Superclocked 602MHZ 896MB 2.052GHZ GDDR3 In SLI |22"Widescreen Phillip LCD l Logitech G15 Keyboard | Logitech G5 Laser Gaming Mouse | 18x + 22x Samsung Sata DVD+RW | Western Digital Caviar 2.8 TB | Antec 1200 Gamer Case | Enermax Galaxy Dxx 1000 Watt Psu | Windows 7 Ultimate

  3. #13
    Join Date
    May 2003
    Posts
    108
    Rep Power
    0

    Default

    Quote Originally Posted by Cue View Post
    You need to change the IIS Anonymous user to a Power user with rights to the folder in question.

    That should do it.

    If the Mapped folder is on a different server then the IIS Anon. User should be a domain user with rights
    to the detsination folder

    Cue is right. Anonymous user may not have access to the folder under IIS. Try changing the Anonymous Username and password to the Domain Administrator username and password under the Directory Security tab in IIS.

    eg. Enter [Domain]/Administrator and password. Replace [Domain] with the Domain Name. If this works, do has Cue stated above:

    Quote Originally Posted by Cue View Post
    If the Mapped folder is on a different server then the IIS Anon. User should be a domain user with rights
    to the detsination folder
    www.pixJM.com - View and upload photos/videos of what's currently happening in the streets of Jamaica.

  4. #14
    Join Date
    Oct 2004
    Posts
    4,814
    Rep Power
    24

    Default

    Quote Originally Posted by codecarnage View Post
    Ok Guys, I have a slightly big problem...I have web application running on IIS which is now required to write files to a mapped directory. I'm receiving what appears to be a permissions error...
    Has anyone suggessfully accomplished this using CLASSIC ASP?

    I do know that setting privileges to "everyone" on the mapped directory won't work because "everyone" context is restricted to the local machine.

    Any information you can share will be greatly appreciated.
    It has nothing to do with permission s, you have to map the drive into the process using the appropraite credentials (username, password). Here is a C# sample from one of my projects to do that. Not sure if you are a C# person but hope this helps.

    Code:
     /// <summary>
            /// Maps a network drive as a local drive to the calling process.
            /// </summary>
            public bool WNetAddConnection(string LocalDrive, string NetworkFolderPath, string User, string Password, bool Force)
            {
                bool success = false;
                try
                {
                    NetResource netresource = new NetResource();
                    netresource.Scope = RESOURCE_GLOBALNET;
                    netresource.Type = RESOURCETYPE_DISK;
                    netresource.Usage = RESOURCEUSAGE_CONNECTABLE;
                    netresource.DisplayType = RESOURCEDISPLAYTYPE_SHARE;
                    netresource.LocalName = LocalDrive;
                    netresource.RemoteName = NetworkFolderPath;
                    netresource.Comment = "";
                    netresource.Provider = "";
    
                    int Flag = CONNECT_UPDATE_PROFILE;
    
                    if(Force)
                    {
                        success = WNetCancelConnection(LocalDrive, true);
                    }
    
                    int result = WNetAddConnection2A(ref netresource, Password, User, Flag);
                    if(result > 0)
                    {
                        throw new System.ComponentModel.Win32Exception(result);
                    }
                    success = true;
                }
                catch(Exception ex) { Logger.Error(ex.Message); }
                return success;
            }
    
    
            /// <summary>
            /// UnMaps a network drive from the calling process.
            /// </summary>
            public bool WNetCancelConnection(string LocalDrive, bool Force)
            {
                bool success = false;
                try
                {
                    int result = WNetCancelConnection2(LocalDrive, CONNECT_UPDATE_PROFILE, Force);
                    if(result > 0)
                    {
                        throw new System.ComponentModel.Win32Exception(result);
                    }
                    success = true;
                }
                catch(Exception ex) { Logger.Error(ex.Message); }
                return success;
            }
    There are some other classes that are needed but you get rthe idea.

  5. #15
    Join Date
    Jul 2004
    Posts
    153
    Rep Power
    0

    Default

    andru, yes i am quite familiar with C# however as i said in the original post its a classic ASP application...i would rather not create a COM object just to accomplish what i need.
    next, while i understand the logic of your code snippet, I am quick to point out that my issue is in fact a permissions\security related issue...microsoft has information to this effect on their support site...So, therefore need to contend with this issue.

    thanks for the post though...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •