How to send filenames containing '#' to WebDAV Server
-
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.
-
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.
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 ♫
-
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 ♫
-
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.
Uri.EscapeDataString
Should encode '#' (as well as others).
-
Uri.EscapeDataString
Should encode '#' (as well as others).