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. C#
  4. How to send filenames containing '#' to WebDAV Server

How to send filenames containing '#' to WebDAV Server

Scheduled Pinned Locked Moved C#
tutorialsysadminlinux
5 Posts 3 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.
  • S Offline
    S Offline
    ShadowUz
    wrote on last edited by
    #1

    Hello. I'm trying upload a file which name contains '#', for example: '#1.doc', or 'myFile#125.exe' to WebDAV Server, which is running on Linux. I use HttpUtility.UrlEncode() Method for encoding URL, but everytime the result will be files with name '1.doc' and 'myFile' on the server. Please, give some advice. Thank you.

    R 1 Reply Last reply
    0
    • S ShadowUz

      Hello. I'm trying upload a file which name contains '#', for example: '#1.doc', or 'myFile#125.exe' to WebDAV Server, which is running on Linux. I use HttpUtility.UrlEncode() Method for encoding URL, but everytime the result will be files with name '1.doc' and 'myFile' on the server. Please, give some advice. Thank you.

      R Offline
      R Offline
      Ravi Sant
      wrote on last edited by
      #2

      Can you please show us the code?

      HttpUtility.UrlEncode()

      Method will replace the

      #

      with

      %23

      Better, try your code without this method.

      // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫

      S 1 Reply Last reply
      0
      • R Ravi Sant

        Can you please show us the code?

        HttpUtility.UrlEncode()

        Method will replace the

        #

        with

        %23

        Better, try your code without this method.

        // ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫

        S Offline
        S Offline
        ShadowUz
        wrote on last edited by
        #3

        I do use HttpUtility.UrlEncode(). But it's not replacing # to %23, simply, leaving it as it is. So, I replaced # to %23 manually. Now it's working. Thank you.

        M 1 Reply Last reply
        0
        • S ShadowUz

          I do use HttpUtility.UrlEncode(). But it's not replacing # to %23, simply, leaving it as it is. So, I replaced # to %23 manually. Now it's working. Thank you.

          M Offline
          M Offline
          Matt Meyer
          wrote on last edited by
          #4

          Uri.EscapeDataString

          Should encode '#' (as well as others).

          S 1 Reply Last reply
          0
          • M Matt Meyer

            Uri.EscapeDataString

            Should encode '#' (as well as others).

            S Offline
            S Offline
            ShadowUz
            wrote on last edited by
            #5

            Thank you. This is really a helpful method.

            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