-
org.apache.commons.net.ftp.FTPClient上传照片问题3
FTPClient client = FtpUtil.CONNECT(site.getHost(), site.getUserName(), site.getPassword(), site.getPort()); // client.enterLocalPassiveMode(); try { client.setFileType(client.BINARY_FILE_TYPE); } catch (IOException ex6) { } // client.setControlEncoding("GB2312"); // client.setRemoteVerificationEnabled(true); InputStream is = null; OutputStream os = null; try { is = new FileInputStream(localFile); } catch (FileNotFoundException ex) { } try { os = client.storeFileStream(FtpUtil.strToIso(remotePath)); } catch (IOException ex1) { } byte[] buffer = new byte[4096]; int bytes = 0; try { int i = 0; while (((bytes = is.read(buffer)) != -1)) { os.write(buffer, 0, bytes); i += bytes; } //end while } catch (IOException ex5) { } try { os.close(); } catch (IOException ex3) { } try { is.close(); } catch (IOException ex4) { } FtpUtil.DISCONNECT(client);
以上是我写的代码。上传照片的底边缘缺像素,为什么,如何才能上传完好无损。2011年7月09日 10:41
目前还没有答案
相关推荐
org.apache.commons.net.ftp.FTPClient包,不错,在实际项目和产品中使用过。
org.apache.commons.net.ftp.FTPClient FTP工具类,实现上传、下载、压缩到输出流下载等功能
FTP应用的jar包,主要用于java开发FTP上传下载
.net.ftp.FTPClient jar ,exaple, commons-net-2.0.jar
NULL 博文链接:https://vakinge.iteye.com/blog/487486
org.apache.commons.net.ftp的官方完整jar包 放心使用
Apache Commons Net » 3.3 org.apache.commons.net.ftp.FTPClient
上传了收集的最新的 commons-io-2.4.jar 包 和 commons-net-3.3.jar 以及 FTP java调用例子。net 包是一个用于操作Internet基础协议(Finger,Whois,TFTP,Telnet,POP3,FTP,NNTP,以及SMTP)的底层API。Net包...
sun.net.ftp.FtpClient,it.sauronsoftware.ftp4j.FTPClient,org.apache.commons.net.ftp.FTPClient三种不同的方式操作FTP
FTPClient封装了所有必要的功能来存储和检索从FTP服务器上的文件。 这个类负责所有与FTP服务器交互的底层细节,并提供了便捷的更高层次的接口。 正如来自所有类SocketClient ,您必须首先连接到与服务器connect做...
import org.apache.commons.io.IOUtils; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply;
Java程序使用Apache的commons-net-3.0.jar包中的org.apache.commons.net.ftp.FTPClient类实现对ftp上传、下载、删除等操作,是一个不错的东西哦
org.apache.commons.net.ftp.FTPClient的最新jar报
该客户端软件使用的是org.apache.commons.net.ftp.FTPClient这个类,FTPClient这个类,该类具体的可查看官网的api文档,链接:FTPClient API,需要自己导入jar包,我下载的是commons-net-3.6.jar,下载链接为...
本项目使用org.apache.commons.net.ftp.FTPClient实现文件上传到ftp服务器,解决不能上传中文文件的问题。
获取ftp服务器文件的大小,从而可以设置下载的进度条
TestFtpUpload 为示例工程 依赖的jar 里面都有 倒入到myeclipse就可使用 ...2. 通过apache:org.apache.commons.net.ftp.FTPClient 3. 通过edtftp: com.enterprisedt.net.ftp.FileTransferClient
org.apache.commons.net.ftp.FTPClient进行上传文件,功能强大 ,可实现文件的上传和下载
基于org.apache.commons.net.ftp.FTPClient; 实现的FTP 上传下载 封装类
开源库的包名是这个org.apache.commons.net.ftp.FTPClient;是属于局域网的ftp上传,要有ip、端口、用户名以及密码。我根据网上的下载demo,自已研究了一番,又封装了一个类自已使用。欢迎访问博客:...