I am trying to upload files created from string text to my ftp server, but I'm having an encoding problem :
Dim request As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.myserver.com/" & Now.Day & Now.Month & Now.Year & Now.Hour & Now.Minute & ".txt"), System.Net.FtpWebRequest)
request.Credentials = New System.Net.NetworkCredential("myusername", "mypassword")
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile
Dim File() As Byte = System.Text.Encoding.ASCII.GetBytes(log)
Dim strZ As System.IO.Stream = request.GetRequestStream()
strZ.Write(File, 0, File.Length)
strZ.Close()
strZ.Dispose()
the log variable being a string, i tried ascii/utf8/unicode when converting the string to the array of bytes, but still, the files uploaded to the ftp don't show a lot of characters like "é", anyone can help me please?