Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Error submitting infopath form

  Asked By: Heena    Date: Dec 12    Category: Sharepoint    Views: 1956

I am running windows sharepoint services on a windows 2k3 server.
I created a infopath form to submit (surprise wait for it info) to a
form library. This completes and creates a filename based on the
person who entered the data and also a folder. I would like to move
the file to the folder

John smith enters data in the infopath form
a folder called jsmith is created and a copy of the infopath form is
inserted into this new created folder.

see code below:

Public Overrides Sub ItemAdded(ByVal properties As
publiccururl = properties.WebUrl
Dim listItem As SPListItem = properties.ListItem
Dim strfilename As String = listItem
Dim list As SPList = listItem.ParentList
Dim xmlUrl As String = properties.AfterUrl
Dim myfolder As SPListItem = list.Folders.Add
(list.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder,
publicfolder = myfolder

Dim site As String = properties.WebUrl
Dim fileurl As String = site + "/" + xmlUrl
Dim numchar As Integer = fileurl.Length
numchar = numchar - 7
fileurl = fileurl.Substring(7, numchar)
fileurl = "\\" + fileurl
fileurl = fileurl.Replace("/", "\")
publicurlsite = fileurl

SPSecurity.CodeToRunElevated(AddressOf ReadXML))

End Sub

Public Sub ReadXML()
Using site As New SPSite(publiccururl)
Using web As SPWeb = site.OpenWeb
Web.AllowUnsafeUpdates = True

Dim webclient As System.Net.WebClient = New
Dim fs As FileStream = webclient.OpenRead(publicurlsite)
Dim docfile2 As SPFile = publicfolder.Folder.Files.Add
("testdoc.xml", fs)

End Using
End Using
End Sub

When the form is summited the file and the folder show up but it is
not moved to the folder.

The only error i get is one in security console on the server :
error on line - Dim fs As FileStream = webclient.OpenRead
Logon Failure:
Reason: An error occurred during logon
User Name: sharepointadin
Domain: domain
Logon Type: 3
Logon Process:
Authentication Package: NTLM
Workstation Name: severname01
Status code: 0xC000006D
Substatus code: 0x0
Caller User Name: -

Any one have an idea on this. Also if you have a better way let me
know that too.



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Error submitting infopath form Or get search suggestion and latest updates.