c# - File name is showing in wrong encode after uploading to ftp server -
after uploading of file ftp server, file name showing ????????. file name contains cyrillic words. inside of file showing correct. should done show correct file names? code here:
fileinfo fileinfo = new fileinfo(filepath); string filename = fileinfo.name.tostring(); webrequest requestftp = webrequest.create(incomingftppath + filename); requestftp.credentials = new networkcredential(ftpusername, ftppassword); requestftp.method = webrequestmethods.ftp.uploadfile; filestream fstream = fileinfo.openread(); int bufferlength = 2048; byte[] buffer = new byte[bufferlength]; stream uploadstream = requestftp.getrequeststream(); int contentlength = fstream.read(buffer, 0, bufferlength); while (contentlength != 0) { uploadstream.write(buffer, 0, contentlength); contentlength = fstream.read(buffer, 0, bufferlength); } uploadstream.close(); fstream.close(); requestftp = null;
Comments
Post a Comment