Hello All,
I'm trying to call a webmethod that accepts three parameters - a filename, a dirname, and an array of byte. The goal is to create the directory passed and transfer the file from client to server. Pretty straightforward.
I'm testing on a WinXP Pro box with IIS 6. When I run my test module however, I get an error dealing with insuffucient access to write to the directory. However, the directory does get created - it just hangs when it tries to create the file and write the bytes to it.
I have tried setting the code access permissions for the .Net framework (i.e. Admin tools - .Net Configuration - Machine - Local Intranet Zene and set the Permission set to full access and the membership condition to all code. Still the same error.
Specifically, I get this error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path "testing" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path)
at System.IO.Directory.CreateDirectory(String path)
at BTFileTransferApps.Service1.SaveThisFile(String filename, String dirname, Byte[] bytearray) in C:\Inetpub\wwwroot\BTFileTransferApps\FileWorks.asmx.vb:line 69
--- End of inner exception stack trace ---
my web service call looks like this:
<WebMethod()> _
Public Sub SaveThisFile(ByVal filename As String, ByVal dirname As String, ByVal bytearray As Byte())
Debug.WriteLine("process started from web...file: " & filename)
Dim ds As Directory
If ds.Exists(dirname) Then
Debug.WriteLine("Dir Exists")
Else
ds.CreateDirectory(dirname)
Debug.WriteLine("Directory Created!")
End If
Dim fullpath As String = "c:\servertest" & "\" & dirname & "\" & filename
Debug.WriteLine("web - dir name: " & dirname)
Debug.WriteLine("web - file name: " & filename)
Debug.WriteLine("web - full name: " & fullpath)
Debug.WriteLine("Attempting to save file!")
Dim fsInput As FileStream = New FileStream(fullpath, FileMode.Create, FileAccess.Write)
fsInput.SetLength(0)
fsInput.Write(bytearray, 0, bytearray.Length)
fsInput.Close()
Debug.WriteLine("File created from Byte Array")
End Sub
anyone have any ideas.
thanx,
inzo
I'm trying to call a webmethod that accepts three parameters - a filename, a dirname, and an array of byte. The goal is to create the directory passed and transfer the file from client to server. Pretty straightforward.
I'm testing on a WinXP Pro box with IIS 6. When I run my test module however, I get an error dealing with insuffucient access to write to the directory. However, the directory does get created - it just hangs when it tries to create the file and write the bytes to it.
I have tried setting the code access permissions for the .Net framework (i.e. Admin tools - .Net Configuration - Machine - Local Intranet Zene and set the Permission set to full access and the membership condition to all code. Still the same error.
Specifically, I get this error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.UnauthorizedAccessException: Access to the path "testing" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path)
at System.IO.Directory.CreateDirectory(String path)
at BTFileTransferApps.Service1.SaveThisFile(String filename, String dirname, Byte[] bytearray) in C:\Inetpub\wwwroot\BTFileTransferApps\FileWorks.asmx.vb:line 69
--- End of inner exception stack trace ---
my web service call looks like this:
<WebMethod()> _
Public Sub SaveThisFile(ByVal filename As String, ByVal dirname As String, ByVal bytearray As Byte())
Debug.WriteLine("process started from web...file: " & filename)
Dim ds As Directory
If ds.Exists(dirname) Then
Debug.WriteLine("Dir Exists")
Else
ds.CreateDirectory(dirname)
Debug.WriteLine("Directory Created!")
End If
Dim fullpath As String = "c:\servertest" & "\" & dirname & "\" & filename
Debug.WriteLine("web - dir name: " & dirname)
Debug.WriteLine("web - file name: " & filename)
Debug.WriteLine("web - full name: " & fullpath)
Debug.WriteLine("Attempting to save file!")
Dim fsInput As FileStream = New FileStream(fullpath, FileMode.Create, FileAccess.Write)
fsInput.SetLength(0)
fsInput.Write(bytearray, 0, bytearray.Length)
fsInput.Close()
Debug.WriteLine("File created from Byte Array")
End Sub
anyone have any ideas.
thanx,
inzo