I have a c# client that uploads files to some server. when my client upload a file with Hebrew name, in server it looks as gibberish. I am pretty sure that the problem is in the client side, since this server works with Hebrew characters from other clients. My question is how to set the content header to be enable to send a Hebrew characters.
Here my code:
using (var content = new MultipartFormDataContent("Upload----" + DateTime.Now.ToString(CultureInfo.InvariantCulture)))
{
using (FileStream filestream = new FileStream(ti.OutPath, FileMode.Open, FileAccess.Read))
{
content.Add(new StreamContent(filestream), "file", "שם עברית.pdf");
//...
}
}
I have tried the following:
content.Add(new StreamContent(file), "file", new string(Encoding.GetEncoding("Windows-1255").GetBytes("שם עברית.pdf").Select(b => (char)b).ToArray()));
but same issue