problem in web client(redundant data added in uploaded file)
-
I am able to upload the a wave file from client computer to my web directory using "PUT" of webclient method Although i've successfully upload the file but when i open the file in server site, it show me the invalid data format. ---------------------------------- Public Function upload(ByVal uriString As String, ByVal fileName As String) as string Try Dim myWebClient As New WebClient() Dim responseArray As Byte() = myWebClient.UploadFile(uriString,"PUT",fileName) return(Encoding.ASCII.GetString(responseArray)) Catch exc As Exception return exc.Message End Try end function ---------------------------------- when i try to test upload a sample text file, i observe that header of the request is also written on file.for example if my file name is "1.txt" and content of the file which is uploaded on the server has content like this -----------------------8c405c905b24bd0 Content-Disposition: form-data; name="file"; filename="1.txt" Content-Type: application/octet-stream elan -----------------------8c405c905b24bd0 i think this is the problem why i always get invalid wave format in server site. Please help me in solving this problem also since I could not find any thing in webclient class to get rid of these headers. Thanks in advance