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. .NET (Core and Framework)
  4. WebClient.UploadFile

WebClient.UploadFile

Scheduled Pinned Locked Moved .NET (Core and Framework)
sysadmintutorial
4 Posts 2 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.
  • N Offline
    N Offline
    nBorshek
    wrote on last edited by
    #1

    I create a txt file which name xx.txt, then I execute the WebClient.UploadFile to upload the file to the server side. The file was uploaded successfully but few lines of header and footer was added to the original context of the file. Please see the example bellow. -----------------------8c8883ecf24ad9e Content-Disposition: form-data; name="file"; filename="xx.txt" Content-Type: application/octet-stream Context of the txt file -----------------------8c8883ecf24ad9e if the uploaded file was jpg, ... format, the system will not be able to reopen the uploaded one because of this header, please advice Nadia Borshek

    H 1 Reply Last reply
    0
    • N nBorshek

      I create a txt file which name xx.txt, then I execute the WebClient.UploadFile to upload the file to the server side. The file was uploaded successfully but few lines of header and footer was added to the original context of the file. Please see the example bellow. -----------------------8c8883ecf24ad9e Content-Disposition: form-data; name="file"; filename="xx.txt" Content-Type: application/octet-stream Context of the txt file -----------------------8c8883ecf24ad9e if the uploaded file was jpg, ... format, the system will not be able to reopen the uploaded one because of this header, please advice Nadia Borshek

      H Offline
      H Offline
      harinath
      wrote on last edited by
      #2

      I am not sure of what you are expecting. it looks like you need to set the content type properly. well, refer to the following web links for some info on the similar topics. Upload handling http://support.microsoft.com/kb/323246/EN-US/ sample products handling uploads. http://www.iisworks.com/fileman/home.asp

      Thanks Harinath India

      N 2 Replies Last reply
      0
      • H harinath

        I am not sure of what you are expecting. it looks like you need to set the content type properly. well, refer to the following web links for some info on the similar topics. Upload handling http://support.microsoft.com/kb/323246/EN-US/ sample products handling uploads. http://www.iisworks.com/fileman/home.asp

        Thanks Harinath India

        N Offline
        N Offline
        nBorshek
        wrote on last edited by
        #3

        Thank you for your reply, but what I am looking for is upload a file to the server withour user inteaction, that why I used WebClient.UploadFile(), then the problem I am facing that I can not review or open the uploaded file again.

        1 Reply Last reply
        0
        • H harinath

          I am not sure of what you are expecting. it looks like you need to set the content type properly. well, refer to the following web links for some info on the similar topics. Upload handling http://support.microsoft.com/kb/323246/EN-US/ sample products handling uploads. http://www.iisworks.com/fileman/home.asp

          Thanks Harinath India

          N Offline
          N Offline
          nBorshek
          wrote on last edited by
          #4

          I want to upload file without user interaction, and at the same time i need to open the file throug the explorer

          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