By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,825 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,825 IT Pros & Developers. It's quick & easy.

HTTP:500 Internal Server Error

P: n/a

Hi All
I am working on a project in which i have to upload files to an remote
server via HTTPS.
For that i have written the following lines of code,but when i execute it I
am getting an
HTTP:500 Internal Server Error.Please let me know where went wrong in it.

1.The client has given the credentials(username & password) using those i
got conneted
to the server successfully,but when i run the below code to upload files
it is giving me the

HTTP:500 Internal Server Error.
Thanks in advance


The code is

Dim postdata As String

Dim encoding As New ASCIIEncoding

Dim myWebRequest As HttpWebRequest =

myWebRequest.Method = "POST"

myHttpWebRequest.ContentType =

postdata = "file" + Microsoft.VisualBasic.ChrW(61) +
"C:\Documents and Settings\vighneswar\My Documents\My Pictures\vighnesh.jpg"

Dim byte1 As Byte() = encoding.GetBytes(postdata)

myWebRequest.ContentLength = postdata.Length

Dim newStream As Stream = myWebRequest.GetRequestStream()

newStream.Write(byte1, 0, byte1.Length)


Dim myWebResponse As WebResponse = myWebRequest.GetResponse()

Dim Rsr As New StreamReader(myResponse.GetResponseStream(),

Dim SResponse As String

SResponse = Rsr.ReadToEnd()


Catch ex As WebException

If ex.Status = WebExceptionStatus.ProtocolError Then

Dim myWebResponse As HttpWebResponse = ex.Response


End Try

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Have you posted this question on forum too?

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.