Показаны сообщения с ярлыком Ftp. Показать все сообщения
Показаны сообщения с ярлыком Ftp. Показать все сообщения
вторник, 22 августа 2023 г.
воскресенье, 5 сентября 2021 г.
понедельник, 13 мая 2019 г.
четверг, 11 января 2018 г.
FTP UpLoad File
https://stackoverflow.com/questions/3576436/upload-a-file-with-encoding-using-ftp-in-c-sharp
private static void up(string sourceFile, string targetFile)
{
try
{
string ftpServerIP = ConfigurationManager.AppSettings["ftpIP"];
string ftpUserID = ConfigurationManager.AppSettings["ftpUser"];
string ftpPassword = ConfigurationManager.AppSettings["ftpPass"];
////string ftpURI = "";
string filename = "ftp://" + ftpServerIP + "//" + targetFile;
FtpWebRequest ftpReq = (FtpWebRequest)WebRequest.Create(filename);
ftpReq.UseBinary = true;
ftpReq.Method = WebRequestMethods.Ftp.UploadFile;
ftpReq.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
byte[] b = File.ReadAllBytes(sourceFile);
ftpReq.ContentLength = b.Length;
using (Stream s = ftpReq.GetRequestStream())
{
s.Write(b, 0, b.Length);
}
FtpWebResponse ftpResp = (FtpWebResponse)ftpReq.GetResponse();
if (ftpResp != null)
{
MessageBox.Show(ftpResp.StatusDescription);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Character Encoding during FTP transfer
http://support.2brightsparks.com/knowledgebase/articles/726108-character-encoding-during-ftp-transfer
While using FTP transfers, SyncBack users sometimes encounter problem with misrepresentation of non-English characters in file names such as umlauts (a mark used over a vowel), accented letters, Chinese or Arabic characters.
FTP is an old protocol (first designed in 1971 with the current protocols from 1985) and the support for non-English characters in file names were not considered when the protocol was initially designed. Therefore, it was designed to be used with English characters only (7-bit ASCII). Later the protocol was extended to use UTF-8 as the character set to support non-English characters in file names.
SyncBack is fully compliant with the extended specifications and uses UTF-8 (Unicode) if the FTP server supports it. However, if you experience problems with FTP transfer using SyncBack, such as copying file names containing non-English characters to your FTP server or file names are shown with wrong characters after they are transferred to your FTP server, then it could be due to one or more of the following reasons:
- Your FTP server follows the original specifications and supports English characters only and rejects those file names with foreign characters.
- Your FTP server violates the specifications and uses custom encoding that SyncBack does not understand.
- If your FTP server states that it is Unicode compatible, then SyncBack will use UTF-8 to transfer files. But if you notice that the file names are shown with wrong characters on your FTP server, then it is possible that the FTP client you are using to view the file names is not Unicode compatible or does not understand Unicode, and hence it displays the file names with wrong characters. Alternatively, you could use an FTP client that is Unicode compatible or download that file from your FTP server using SyncBack and verify the file names on your local drive.
Note that if your FTP Server or client (used to view the transferred files) are not Unicode compatible then please upgrade to FTP software that uses UTF-8 (for example FileZilla - https://filezilla-project.org/) or refrain from using foreign characters.
https://winscp.net/eng/docs/ui_login_environment#utf
пятница, 22 декабря 2017 г.
вторник, 28 ноября 2017 г.
FTP parse WebRequestMethods.Ftp.ListDirectoryDetails
https://stackoverflow.com/questions/7060983/c-sharp-class-to-parse-webrequestmethods-ftp-listdirectorydetails-ftp-response
https://stackoverflow.com/questions/1013486/parsing-ftpwebrequest-listdirectorydetails-line#40045894
https://blogs.msdn.microsoft.com/adarshk/2004/09/15/sample-code-for-parsing-ftpwebrequest-response-for-listdirectorydetails/
http://www.seesharpdot.net/?p=242
https://gist.github.com/tobiasoberrauch/2942716
http://www.rantdriven.com/post/2010/12/03/Parsing-FTP-LIST-Command-Results.aspx
https://winscp.net/eng/docs/library
понедельник, 27 ноября 2017 г.
FTP C# Examples
UpLoad and Delete
https://stackoverflow.com/questions/17617203/deleting-file-from-ftp-in-c-sharp
Make Directory
https://stackoverflow.com/questions/860638/how-do-i-create-a-directory-on-ftp-server-using-c
DELETE Directory
https://stackoverflow.com/questions/4797508/how-can-ftpclient-delete-a-directory
http://www.cyberforum.ru/csharp-net/thread2010946.html
http://www.cyberforum.ru/csharp-net/thread963078.html
FTP 2017
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/ftp
Download
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-download-files-with-ftp
UpLoad
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-upload-files-with-ftp
GetDirList
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-list-directory-contents-with-ftp
WebRequest Problems and Exceptions
https://docs.microsoft.com/en-us/dotnet/framework/network-programming/understanding-webrequest-problems-and-exceptions
FTP 2016
https://msdn.microsoft.com/ru-ru/library/system.net.ftpwebrequest(v=vs.110).aspx
https://msdn.microsoft.com/ru-ru/library/system.net.ftpwebrequest.keepalive(v=vs.110).aspx
https://msdn.microsoft.com/ru-ru/library/system.net.ftpwebresponse.close(v=vs.110).aspx
FTP 2010
https://msdn.microsoft.com/en-us/library/ms229718(v=vs.100).aspx
https://msdn.microsoft.com/en-us/library/ms229716(v=vs.100).aspx
https://msdn.microsoft.com/en-us/library/ms229711(v=vs.100).aspx
https://msdn.microsoft.com/en-us/library/ms229715(v=vs.100).aspx
вторник, 5 января 2016 г.
суббота, 10 января 2015 г.
среда, 19 марта 2014 г.
Magic command for Ftp
netsh advfirewall firewall add rule name="FTP (non-SSL)" action=allow protocol=TCP dir=in localport=21
netsh advfirewall set global StatefulFtp enable
netsh advfirewall set global StatefulFtp enable
Подписаться на:
Сообщения (Atom)
