473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Looking for help

Hello,

I need some help and if anyone can figure this out I will bow to
him/her. We have a vb.net app that is trying to transfer files from a
client's w2k tablet pc to our server. The app is deployed on more than 60
clients. For some of the clients they get a 401 error when running this part
of the program that uploads the files. There are about 3 clients that
constantly get the error and about 5 that get it randomly, the other 52
people do not have a problem. Each client has different ISP's, run the
application at different times, basically there isn't a common factor I can
see between them. I would greatly appreciate any help someone can give me.
Below is the code.

vb.net app
function uploadphotos

Try
Dim f As System.IO.File

Dim fs As System.IO.FileStream

Dim Service As New localhost.vcrservice300

Dim credentials As System.Net.NetworkCredential = New
System.Net.NetworkCredential("USER", "PASS")

Service.Credentials = credentials

Service.Url = ServiceUrl

Service.Timeout = 3600000

Dim TstUpload As String

fs = f.Open(UploadDirectory & filename, IO.FileMode.Open,
IO.FileAccess.Read)

Dim b(CInt(fs.Length) - 1) As Byte

fs.Read(b, 0, CInt(fs.Length))

Try

TstUpload = Service.UploadFile(b, filename).ToString

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" & filename
& " " & ex.Message, "79", " Trace: " & ex.StackTrace.ToString)

****exception thrown here****

Return False

End Try

f = Nothing

fs.Close()

Service.Dispose()

Return True

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" &
filename, "80", " Trace: " & ex.StackTrace.ToString)

Return False

End Try
webservice---this code is pretty much the standard I have seen on the net.
i.e. codeproject.com
<WebMethod()> Public Function UploadFile(ByVal fs() As Byte, ByVal FlName As
String) As Boolean

Try

Dim m As New System.IO.MemoryStream(fs)

Dim f As New System.IO.FileStream("e:\files\" & FlName, IO.FileMode.Create)

m.WriteTo(f)

m.Close()

f.Close()

f = Nothing

m = Nothing

Return True

Catch ex As Exception

Return False

End Try

End Function

The 401 gets thrown if we have anonymous set to either on/off in IIS 6. I
have checked with our ISP and our T1 is not being maxed out.

Client w2k
Server w2k3
Nov 21 '05 #1
2 1052
Hi,

Just a guess but could the 3 clients have a hardware firewall
that is blocking the method.

Ken
-------------
"Jake" <ro******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

I need some help and if anyone can figure this out I will bow to
him/her. We have a vb.net app that is trying to transfer files from a
client's w2k tablet pc to our server. The app is deployed on more than 60
clients. For some of the clients they get a 401 error when running this part
of the program that uploads the files. There are about 3 clients that
constantly get the error and about 5 that get it randomly, the other 52
people do not have a problem. Each client has different ISP's, run the
application at different times, basically there isn't a common factor I can
see between them. I would greatly appreciate any help someone can give me.
Below is the code.

vb.net app
function uploadphotos

Try
Dim f As System.IO.File

Dim fs As System.IO.FileStream

Dim Service As New localhost.vcrservice300

Dim credentials As System.Net.NetworkCredential = New
System.Net.NetworkCredential("USER", "PASS")

Service.Credentials = credentials

Service.Url = ServiceUrl

Service.Timeout = 3600000

Dim TstUpload As String

fs = f.Open(UploadDirectory & filename, IO.FileMode.Open,
IO.FileAccess.Read)

Dim b(CInt(fs.Length) - 1) As Byte

fs.Read(b, 0, CInt(fs.Length))

Try

TstUpload = Service.UploadFile(b, filename).ToString

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" & filename
& " " & ex.Message, "79", " Trace: " & ex.StackTrace.ToString)

****exception thrown here****

Return False

End Try

f = Nothing

fs.Close()

Service.Dispose()

Return True

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" &
filename, "80", " Trace: " & ex.StackTrace.ToString)

Return False

End Try
webservice---this code is pretty much the standard I have seen on the net.
i.e. codeproject.com
<WebMethod()> Public Function UploadFile(ByVal fs() As Byte, ByVal FlName As
String) As Boolean

Try

Dim m As New System.IO.MemoryStream(fs)

Dim f As New System.IO.FileStream("e:\files\" & FlName, IO.FileMode.Create)

m.WriteTo(f)

m.Close()

f.Close()

f = Nothing

m = Nothing

Return True

Catch ex As Exception

Return False

End Try

End Function

The 401 gets thrown if we have anonymous set to either on/off in IIS 6. I
have checked with our ISP and our T1 is not being maxed out.

Client w2k
Server w2k3

Nov 21 '05 #2
Ken,

Thanks for the response. No each of the clients is actually running this
application from there home. Some are behind routers but the routers are not
the same and some are not even behind routers.

Jake

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

Just a guess but could the 3 clients have a hardware firewall
that is blocking the method.

Ken
-------------
"Jake" <ro******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello,

I need some help and if anyone can figure this out I will bow to
him/her. We have a vb.net app that is trying to transfer files from a
client's w2k tablet pc to our server. The app is deployed on more than 60
clients. For some of the clients they get a 401 error when running this part of the program that uploads the files. There are about 3 clients that
constantly get the error and about 5 that get it randomly, the other 52
people do not have a problem. Each client has different ISP's, run the
application at different times, basically there isn't a common factor I can see between them. I would greatly appreciate any help someone can give me.
Below is the code.

vb.net app
function uploadphotos

Try
Dim f As System.IO.File

Dim fs As System.IO.FileStream

Dim Service As New localhost.vcrservice300

Dim credentials As System.Net.NetworkCredential = New
System.Net.NetworkCredential("USER", "PASS")

Service.Credentials = credentials

Service.Url = ServiceUrl

Service.Timeout = 3600000

Dim TstUpload As String

fs = f.Open(UploadDirectory & filename, IO.FileMode.Open,
IO.FileAccess.Read)

Dim b(CInt(fs.Length) - 1) As Byte

fs.Read(b, 0, CInt(fs.Length))

Try

TstUpload = Service.UploadFile(b, filename).ToString

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" & filename & " " & ex.Message, "79", " Trace: " & ex.StackTrace.ToString)

****exception thrown here****

Return False

End Try

f = Nothing

fs.Close()

Service.Dispose()

Return True

Catch ex As Exception

SendErrorToDB("HH3 Name: " & HH3Name & ": Failed to upload file:" &
filename, "80", " Trace: " & ex.StackTrace.ToString)

Return False

End Try
webservice---this code is pretty much the standard I have seen on the net.
i.e. codeproject.com
<WebMethod()> Public Function UploadFile(ByVal fs() As Byte, ByVal FlName As String) As Boolean

Try

Dim m As New System.IO.MemoryStream(fs)

Dim f As New System.IO.FileStream("e:\files\" & FlName, IO.FileMode.Create)
m.WriteTo(f)

m.Close()

f.Close()

f = Nothing

m = Nothing

Return True

Catch ex As Exception

Return False

End Try

End Function

The 401 gets thrown if we have anonymous set to either on/off in IIS 6. I
have checked with our ISP and our T1 is not being maxed out.

Client w2k
Server w2k3

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Chris Lott | last post by:
I already use and am happy with a variety of text editors (vim, emacs, ultraedit, jedit, Homesite) depending on my needs, but I would like recommendations for a PHP specific IDE that will run on...
1
by: newsgroupsYOUKNOWWHATTODO | last post by:
Hi Folks, I've been contemplating two things for a php project I'm working on : 1) doing user security stuff (users, admins, super-admins etc), pref. compatible with win32 2) doing...
14
by: Jason Daly | last post by:
I'm a freshman at college as a computer science major. I'm not sure it has what I want. Does anyone know if a major commonly exists in web design (focusing in server side languages)? I want to...
4
by: ÂÑTØÑ | last post by:
Hi, I was looking for a list of commands, but I can't find it. It's about commands you can type in the Internet Explorer adress bar, to get some information about a website. For instance...
2
by: Wayne Wengert | last post by:
I hope this is an appropriate group for this question? I work with a non-profit group that uses SQL Server 2000 for their data backend. They have a moderate size web site with many data driven...
24
by: Kevin | last post by:
Hey guys. I'm looking to get together some VB programmers on Yahoo messenger. I sit at a computer and program all day. I have about 3 or 4 people already, but it would be really cool to have a...
2
by: John | last post by:
Hi I am looking for an exception handler that can handle all unhanded exceptions in my vb2005 app and also email the exception log to myself. There is one here...
12
by: amogan | last post by:
**If interested & qualified, please reply with your resume directly to amogan@google.com** Referrals are always welcome!! Network System Test Engineer - Mountain View This position is...
3
by: lalit_bhatia | last post by:
Looking for a good help desk/ dash board in ASP. Any body worked before on this type of project can help in conceptulization Thanks
1
by: ncsthbell | last post by:
I am looking for any help with calling 'Acrobat Distiller' using an API from within Access. I have searched on the Internet and it is so very confusing!! I have the product installed but am looking...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.