Hi there,
I'm trying to convert some of the code found in the demo file to a .jsp file. I've worked all errors out, but still not doing what it is supposed to do.
What I want: Implement code into JSP so that users can upload files via an upload form. The ip-host is static but the user and password need to be checked with database later on. In this try-out I set all values static, trying to build it up from the ground.
Here is the code so far:
<%@ page language="java" %>
<%@ page contentType="text/html; charset=ISO-8859-1" %>
<%@ page import="com.enterprisedt.net.ftp.FTPClient" %>
<%@ page import="com.enterprisedt.net.ftp.FTPMessageCollector" %>
<%@ page import="com.enterprisedt.net.ftp.FTPTransferType" %>
<%@ page import="com.enterprisedt.net.ftp.FTPConnectMode" %>
<%@ page import="com.enterprisedt.util.debug.Level" %>
<%@ page import="com.enterprisedt.util.debug.Logger" %>
<%!
public void jspMain(String[] args){
String[] s = new String[3];
s[0] = "localhost";
s[1] = "myUser";
s[2] = "myPassword";
FTPClient ftp = null;
try {
ftp = new FTPClient(s[0]);
ftp.login(s[1], s[2]);
ftp.setConnectMode(FTPConnectMode.PASV);
ftp.setType(FTPTransferType.ASCII);
ftp.quit();
}
catch(Exception ex){
ex.printStackTrace();
}
}
%>
<HTML>
<HEAD>
<TITLE>Demo of JSP to FTP connection</TITLE>
</HEAD>
<BODY>
testing your ftp
</BODY>
</HTML>
No errors are generated, or maybe somewhere hidden I dont know off. Is it something I did wrong in coding? I was so glad that no errors where generated (real milestone for me), anyone an idea how to get it working?
Signed,
NexceveN