File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Hi  Please Help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Hi  Please Help me" Watch "Hi  Please Help me" New topic
Author

Hi Please Help me

Jitendra Nayak
Greenhorn

Joined: Mar 13, 2006
Posts: 9
hi

1. am using Apche comms .net api to tansfer single image file(tif).

2.port 21 only opened in wins Nt server.

3.manually i can transfer the images thrg FTP.

4.please thr API (binary mode and Ascii am transferring images).

am not able to see images.(inthe path)

is it possible to use port 22 (client res ask me to use only 22)

please what are info i should consider while transfer image to FTP.

what info i should collect from sys/net admin abt server?




code:
=====
FTPClient ftp = new FTPClient();
ftp.connect( server );
ftp.setDefaultPort(FTP.DEFAULT_PORT);//ftp.port
int gg = ftp.getDefaultPort();
System.out.println("The port number id ="+gg);

ftp.login( username, password);

System.out.println("Connected to " + server + ".");
int reply = ftp.getReplyCode();
System.out.print(ftp.getReplyString()+"FROM TEXT FTP CODE="+reply);

if (!FTPReply.isPositiveCompletion(reply))
{
ftp.disconnect();
System.err.println("FTP server refused connection.");
System.exit(1);
}

ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.changeWorkingDirectory(desFolder);

InputStream input;

input = new FileInputStream(srcFolder);
System.out.println("The value of = "+input.toString());
ftp.storeFile(desFolder,input);
System.out.println("The value after store file of");
input.close();
System.out.println("The value after closing stream ");


C://please hlp me?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hi Please Help me