Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. problem in web client(redundant data added in uploaded file)

problem in web client(redundant data added in uploaded file)

Scheduled Pinned Locked Moved Visual Basic
helpsysadmintutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yccheok
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups