ASP.Net Security Problem

Discussion in 'ASP .Net Security' started by Sanjay Malhotra @yahoo.com>, Feb 19, 2004.

  1. Hi

    I have a problem with permissions with an ASP.Net Application and IIS and SharePoint on Windows 2000 SP4 with .Net Framework 1.1.4322. The SharePoint 2001 SP 2a Portal Server is setup for Internet Access(Extranet Solution)

    I have a very simple piece of code that uploads a documents to a SPS 2001 SP2a server( see code below ). The code works fine on the server when the Virtual Directory I create is under the default web

    The application code is located on the c drive at c:\VBDocUpload and the code is snippet belo
    ------------------------------------------------------------------------------------------------------------------------------------------
    oDoc = New PKMCDO.KnowledgeDocumen
    oStream = oDoc.OpenStrea
    oStream.Type = ADODB.StreamTypeEnum.adTypeBinar
    oStream.SetEOS(
    oStream.LoadFromFile("c:\test.doc"
    oStream.Flush(
    oStream.Close(
    Response.Write(iStep.ToString + "<BR>"
    oDoc.ContentClass = "urn:content-classes:FAQ
    oDoc.Title = "Hello Everyone
    oDoc.Description = "This is a description
    oDoc.DataSource.SaveTo("http://www.ourcompany.com/Workspace/documents/test.doc, , , , , "username", "password"
    ------------------------------------------------------------------------------------------------------------------------------------------

    When the virtual directory is under default web http://localhost/DocUploadVB/webform1.aspx this code uploads the documents to the SPS 2001 server and everything is fine. Virtual Directory points to c:\VBDocUpload, IIS permission are the same

    When we installed SPS 2001 we ran the extranet setup and it created a new web in IIS this web is called www.ourcompany.com. When I create a virtual directory under this new website and point the virtual directory to c:\VBDocUpload the same code fails wit

    ==========================================================================
    System.Exception
    System.Exception System.Runtime.InteropServices.COMException (0x8007010B): The directory name is invalid. at PKMCDO.IDataSource.SaveTo(String SourceURL, Object ActiveConnection, ConnectModeEnum Mode, RecordCreateOptionsEnum CreateOptions, RecordOpenOptionsEnum Options, String UserName, String Password) at DocUploadVB.WebForm1.btnUpload_Click(Object sender, EventArgs e
    Error Message: The directory name is invalid.
    ex.Source:CDO.KnowledgeDocument.
    ex.StackTrace: at PKMCDO.IDataSource.SaveTo(String SourceURL, Object ActiveConnection, ConnectModeEnum Mode, RecordCreateOptionsEnum CreateOptions, RecordOpenOptionsEnum Options, String UserName, String Password) at DocUploadVB.WebForm1.btnUpload_Click(Object sender, EventArgs e
    ex.TargetSite.Name:SaveT
    ==========================================================================

    Any help would be appreicated as we have hit a wall on this issue. My assumption is that it has to with .Net Permissions(Code Groups, Permission Sets). THe .Net configuration has not been changed since installation.

    Thanks in advanc
    Sanjay Malhotr
    manjos<nospam>@yahoo.com
     
    Sanjay Malhotra @yahoo.com>, Feb 19, 2004
    #1
    1. Advertising

  2. Have you checked if the NTFS permissions on the folder are the same as the
    folder for the Default Web Site?

    HtH,

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Sanjay Malhotra @yahoo.com>" <manjos<nospam> wrote in message
    news:...
    > Hi,
    >
    > I have a problem with permissions with an ASP.Net Application and IIS and

    SharePoint on Windows 2000 SP4 with .Net Framework 1.1.4322. The SharePoint
    2001 SP 2a Portal Server is setup for Internet Access(Extranet Solution).
    >
    > I have a very simple piece of code that uploads a documents to a SPS 2001

    SP2a server( see code below ). The code works fine on the server when the
    Virtual Directory I create is under the default web.
    >
    > The application code is located on the c drive at c:\VBDocUpload and the

    code is snippet below
    > --------------------------------------------------------------------------

    -----------------------------------------------------------------
    > oDoc = New PKMCDO.KnowledgeDocument
    > oStream = oDoc.OpenStream
    > oStream.Type = ADODB.StreamTypeEnum.adTypeBinary
    > oStream.SetEOS()
    > oStream.LoadFromFile("c:\test.doc")
    > oStream.Flush()
    > oStream.Close()
    > Response.Write(iStep.ToString + "<BR>")
    > oDoc.ContentClass = "urn:content-classes:FAQ"
    > oDoc.Title = "Hello Everyone"
    > oDoc.Description = "This is a description"
    >

    oDoc.DataSource.SaveTo("http://www.ourcompany.com/Workspace/documents/test.d
    oc, , , , , "username", "password")
    > --------------------------------------------------------------------------

    -----------------------------------------------------------------
    >
    > When the virtual directory is under default web

    http://localhost/DocUploadVB/webform1.aspx this code uploads the documents
    to the SPS 2001 server and everything is fine. Virtual Directory points to
    c:\VBDocUpload, IIS permission are the same.
    >
    > When we installed SPS 2001 we ran the extranet setup and it created a new

    web in IIS this web is called www.ourcompany.com. When I create a virtual
    directory under this new website and point the virtual directory to
    c:\VBDocUpload the same code fails with
    >
    >

    ===========================================================================
    > System.Exception
    > System.Exception System.Runtime.InteropServices.COMException (0x8007010B):

    The directory name is invalid. at PKMCDO.IDataSource.SaveTo(String
    SourceURL, Object ActiveConnection, ConnectModeEnum Mode,
    RecordCreateOptionsEnum CreateOptions, RecordOpenOptionsEnum Options, String
    UserName, String Password) at DocUploadVB.WebForm1.btnUpload_Click(Object
    sender, EventArgs e)
    > Error Message: The directory name is invalid.
    > ex.Source:CDO.KnowledgeDocument.1
    > ex.StackTrace: at PKMCDO.IDataSource.SaveTo(String SourceURL, Object

    ActiveConnection, ConnectModeEnum Mode, RecordCreateOptionsEnum
    CreateOptions, RecordOpenOptionsEnum Options, String UserName, String
    Password) at DocUploadVB.WebForm1.btnUpload_Click(Object sender, EventArgs
    e)
    > ex.TargetSite.Name:SaveTo
    >

    ===========================================================================
    >
    > Any help would be appreicated as we have hit a wall on this issue. My

    assumption is that it has to with .Net Permissions(Code Groups, Permission
    Sets). THe .Net configuration has not been changed since installation.
    >
    > Thanks in advance
    > Sanjay Malhotra
    > manjos<nospam>@yahoo.com
     
    Andrea D'Onofrio [MSFT], Feb 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick
    Replies:
    2
    Views:
    677
    Steven Cheng[MSFT]
    Oct 1, 2004
  2. Dinis Cruz

    Asp.Net Security Analyser (new security tool by DDPlus)

    Dinis Cruz, Oct 8, 2003, in forum: ASP .Net Security
    Replies:
    2
    Views:
    170
    Dinis Cruz
    Oct 11, 2003
  3. Dinis Cruz
    Replies:
    1
    Views:
    137
    Susan Bradley, CPA aka Ebitz - SBS Rocks [MVP]
    Oct 17, 2003
  4. Michael Randrup
    Replies:
    3
    Views:
    340
    Henning Krause [MVP]
    Mar 27, 2006
  5. Kursat
    Replies:
    1
    Views:
    334
    Dominick Baier
    May 7, 2007
Loading...

Share This Page