commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabio Cuomo" <mu...@hotmail.com>
Subject Problem with FTP transfer image...Please Help me
Date Thu, 01 Jul 2004 13:34:07 GMT
Hi at all,
I've have a problem with FTP Transfer image. Problem involves when, after 
connect to remote ftp server and do a right login, i try to send a local 
file (an image file, .jpg, .gif, ,png, etc) to remote ftp server. Transfer 
happens but the content of transferred file is corrupt, or rather i see my 
remote image as corrupt image, remote image size is less than original image 
size.
Here i attach my piece of code:

	try {
		ftp.connect(host);
		if(!ftp.login(user, password)) {
			ftp.logout();
                                }
                               ftp.enterLocalPassiveMode();
                               ftp.setFileType(FTP.BINARY_FILE_TYPE);
	               InputStream in = new FileInputStream(current);
	               ftp.storeFile(remote,in);
	               in.close();
                              ftp.disconnect();
	} catch (Exception e) {}

In this example i use windows ftp server.
i can't understand error, i tried to upload a plain text file and all is 
correct, but when i try to upload image file i get a corrupt image file on 
remote server.
Please help me, i'm in trouble.

Tnx in advance
regards mulp

_________________________________________________________________
Scarica gratuitamente MSN Toolbar! http://toolbar.msn.it/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message