FTP Problem

hi all ,

i wrote a program that send File to ftp server .

the Problem when i Send a sound file . when I open the file from the Ftp server or download it the file open but there is no sound appear.

here is the the function that send the ftp file :

public void sendFile(String IP, String filePath,String userName,String password,String destinationPath , String fileName) throws Exception {

try{

FileInputStream in = new FileInputStream(new File(filePath));

FTPClient ftp = new FTPClient(); //define new ftp client.

if (in != null) {

ftp.connect(IP,ftp.getDefaultPort()); // connect to the host

}

try {

ftp.login(userName,password);//login to the host by the user name and password

} catch(Exception e) {

}

ftp.storeFile(fileName,(InputStream)in); // upload the file in the directory.

ftp.logout();//log out from the host

//in.close();// Close the connection to the stream file.

}

finally{

}

}

i am using the Apachee API

Please help me

Message was edited by:

Husam

Message was edited by:

Husam

[1162 byte] By [Husama] at [2007-11-27 1:18:55]
# 1
Where is the FTPClient defined ?
java.eea at 2007-7-11 23:55:01 > top of Java-index,Core,Core APIs...
# 2
FTPClient ftp = new FTPClient(); //define new ftp client.this is the definition of the FTP Client and it's at the beginig of the sendFile method
Husama at 2007-7-11 23:55:01 > top of Java-index,Core,Core APIs...
# 3
Dear Husam,Can u write me the API specification for ftp package?i wanna see more methods n classes.
java.eea at 2007-7-11 23:55:01 > top of Java-index,Core,Core APIs...
# 4
thanks for replayActually I don't have the Specificatio for the API but you can get thr spec from the apachee site.I also will try to read about the specificationi would like to ask you where are you from?
Husama at 2007-7-11 23:55:01 > top of Java-index,Core,Core APIs...
# 5
My guess is that its transferring the files in ASCII mode. Try this:FTPClient ftpClient = new FTPClient();ftpClient.setFileTransferMode(FTP.Binary_File_Type);
JasonChoya at 2007-7-11 23:55:01 > top of Java-index,Core,Core APIs...