How Connect to remote host from Aptana Studio 3

From the Project Explorer, expand the project you want to hook up to a remote site (or just right click and create a new Web project that’s empty if you just want to explore a remote site from there). There’s a “Connections” node, right click it and select “Add New connection…”. A dialog will appear, … Read more

How to use passive FTP mode in Windows command prompt?

The Windows FTP command-line client (ftp.exe) does not support the passive mode, on any version of Windows. It makes it pretty useless nowadays due to ubiquitous firewalls and NATs. Using the quote pasv won’t help. It switches only the server to the passive mode, but not the client. Use any thirdparty Windows FTP command-line client … Read more

How to check if file exists on FTP before FtpWebRequest

var request = (FtpWebRequest)WebRequest.Create (“ftp://ftp.domain.com/doesntexist.txt”); request.Credentials = new NetworkCredential(“user”, “pass”); request.Method = WebRequestMethods.Ftp.GetFileSize; try { FtpWebResponse response = (FtpWebResponse)request.GetResponse(); } catch (WebException ex) { FtpWebResponse response = (FtpWebResponse)ex.Response; if (response.StatusCode == FtpStatusCode.ActionNotTakenFileUnavailable) { //Does not exist } } As a general rule it’s a bad idea to use Exceptions for functionality in your code like … Read more

How do I create a directory on FTP server using C#?

Use FtpWebRequest, with a method of WebRequestMethods.Ftp.MakeDirectory. For example: using System; using System.Net; class Test { static void Main() { WebRequest request = WebRequest.Create(“ftp://host.com/directory”); request.Method = WebRequestMethods.Ftp.MakeDirectory; request.Credentials = new NetworkCredential(“user”, “pass”); using (var resp = (FtpWebResponse) request.GetResponse()) { Console.WriteLine(resp.StatusCode); } } }

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