java做的比较完善的FTP上传下载文件服务器源码(5)

2021-04-05 14:06

java做的比较完善的FTP上传下载文件服务器源码

message = "下载"+filepathname+"文件到"+baddir +"目录成功!";

System.out.println(message);

log(RWFileDir,message);

}

catch(IOException e){

message = "下载"+filepathname+"文件到"+baddir +"目录失败!"+e;

System.out.println(message);

log(RWFileDir,message);

result = false ;

}

}

else{

result = false;

}

return result;

}

public boolean uploadFile(String RWFileDir,String filepathname){

boolean result=true; 字串8

String message = "";

if (aftp != null)

{

System.out.println("正在上传文件"+filepathname+",请等待....");

try{

String fg =new String("\\subunsubfromsp\\");

int index = stIndexOf(fg);

String filename = filepathname.substring(index+1);

File localFile = new File(filepathname) ;

RandomAccessFile sendFile = new RandomAccessFile(filepathname,"r"); //

sendFile.seek(0);

//改名上传temp_

filename

filename.substring(0,15)+"temp_"+filename.substring(15,filename.length()); outs = aftp.put(filename);

outputs = new DataOutputStream(outs); 字串8

while (sendFile.getFilePointer() < sendFile.length() )

{

ch = sendFile.read(); =


java做的比较完善的FTP上传下载文件服务器源码(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:缺表测电阻七例十法

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: