List file names based on a filename pattern and file content?

Grep DOES NOT use “wildcards” for search – that’s shell globbing, like *.jpg. Grep uses “regular expressions” for pattern matching. While in the shell ‘*’ means “anything”, in grep it means “match the previous item zero or more times”. More information and examples here: http://www.regular-expressions.info/reference.html To answer of your question – you can find files … Read more

Error in FTP connection using domain name, username and password?

I had this error too. My domian name was a subdomain like xxx.yyy.com And cpanel ftp configuration guided me that ftp server is ftp.xxx.yyy.com Fillzilla was unable to connect and showed this error: Connection attempt failed with “EAI_NONAME – Neither nodename nor servname provided, or not known”. This error is for dns resolving. I just … Read more

How to List Directory Contents with FTP in C#?

Try this: FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(uri); ftpRequest.Credentials =new NetworkCredential(“anonymous”,”janeDoe@contoso.com”); ftpRequest.Method = WebRequestMethods.Ftp.ListDirectory; FtpWebResponse response = (FtpWebResponse)ftpRequest.GetResponse(); StreamReader streamReader = new StreamReader(response.GetResponseStream()); List<string> directories = new List<string>(); string line = streamReader.ReadLine(); while (!string.IsNullOrEmpty(line)) { directories.Add(line); line = streamReader.ReadLine(); } streamReader.Close(); It gave me a list of directories… all listed in the directories string list… tell me … Read more

Android FTP Library [closed]

Try using apache commons ftp FTPClient ftpClient = new FTPClient(); ftpClient.connect(InetAddress.getByName(server)); ftpClient.login(user, password); ftpClient.changeWorkingDirectory(serverRoad); ftpClient.setFileType(FTP.BINARY_FILE_TYPE); BufferedInputStream buffIn = null; buffIn = new BufferedInputStream(new FileInputStream(file)); ftpClient.enterLocalPassiveMode(); ftpClient.storeFile(“test.txt”, buffIn); buffIn.close(); ftpClient.logout(); ftpClient.disconnect();

421 Sorry, cleartext sessions are not accepted on this server.

“421 Sorry, cleartext sessions are not accepted on this server” means that the server is using “FTP Over Explicit TLS/SSL”. This is a Good Thing. You might be able to fix it by giving the protocol “ftpes:” instead of “ftp:”: ftpes://ftp.somesite.com/some_folder … or … ftps://ftp.somesite.com/some_folder You’ll probably need to use another FTP client besides your … Read more

How can I unzip a file to a .NET memory stream?

Zip compression support is built in: using System.IO; using System.IO.Compression; // ^^^ requires a reference to System.IO.Compression.dll static class Program { const string path = … static void Main() { using(var file = File.OpenRead(path)) using(var zip = new ZipArchive(file, ZipArchiveMode.Read)) { foreach(var entry in zip.Entries) { using(var stream = entry.Open()) { // do whatever we … Read more

Differences between SFTP and “FTP over SSH”

Here is the difference: SFTP (SSH file transfer protocol) is a protocol that provides file transfer and manipulation capabilities. It can work over any reliable data stream, but is typically used with SSH “FTP over SSH” uses the regular old FTP protocol, but an SSH tunnel is placed between client and server. You probably won’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)