Hi! I am creating an application that will upload a local file to an FTP site. The FTP server needs account and password to be accessed. How do I write the password inside the code? myaccount@ftp://oursite.com ?mypassword? Thanks, Eugene
Generally, it's considered bad practice to put the password directly into the URL string, however, you can do ftp://username:firstname.lastname@example.org:port/directory. You can get the username and password out using a java.net.URL.getUserInfo() which will return you "username:password" Alternatively, if you use javax.mail.URLName (from JavaMail api) you can do URLName.getUsername(), and URLName.getPassword()
I have no java certifications. This makes me a bad programmer. Ignore my post.