你没有给出相应的环境,我也没有办法适合你的程序是在客户端实现这个方法还是在服务端实现这个方法
客户端:你可以提交一点信息以完成服务端执行某个方法
服务端:在IMAGE提交后,或是某个事件后做一个方法
客户端:你可以提交一点信息以完成服务端执行某个方法
服务端:在IMAGE提交后,或是某个事件后做一个方法
解决方案 »
- The method createStmt(Connection) in the type DB is not applicable for the argum
- 关于Eclipse做web开发
- 分页出错:by zero
- 服务器端响应的Cookie和客户端设置的Cookie两者有啥区别....
- 数据库查询出错,大家帮忙看看错在哪里?
- jsp中向数据库插入数据报错!!!
- JSValidation验证框架1.0b1发布
- 为什么我用流从文件中读取,然后显示在页面的时候是二进制乱码,而不是文件内容?
- 谁能帮我解决这个问题,我给您1000分
- 关于Servlet的导入java package?
- 目前在企业级应用中最常用的中间件服务器是什么?weblogic
- *****关于连接池的Datasource**********
我想知道的是如何复制文件。不知道我有没有表达明白
package cscec.news;
import java.io.*;
public class copyFile{
public void copyFile(){}
public void copyFiles(String fileSource,String fileAim){
File myFile1,myFile2;
//FileWriter out;
FileInputStream myfileStream;
FileOutputStream myfileOutStream;
DataInputStream dataInStream;
DataOutputStream dataOutStream;
String filePath1=fileSource;
String filePath2=fileAim;
int iLength;
myFile1 = new File(filePath1);
myFile2 = new File(filePath2);
try{
if(!myFile1.exists()){
myFile1.createNewFile();
}
if(!myFile2.exists()){
myFile2.createNewFile();
}
}catch (IOException e)
{
System.out.println(e.getMessage());
System.out.print("it does not exist----------");
}
//打开输入流并读信息
try{
myfileStream = new FileInputStream(myFile1);
dataInStream = new DataInputStream(myfileStream);
myfileOutStream = new FileOutputStream(myFile2);
dataOutStream = new DataOutputStream(myfileOutStream);
while((iLength=dataInStream.read())!=-1){
//输出\r
dataOutStream.write(iLength);
System.out.print(iLength);
}
dataInStream.close();
myfileStream.close();
myfileOutStream.close();
dataOutStream.close();
}catch(IOException e)
{
System.out.println(e.getMessage());
}
}
}