// 上传文件
public void upload(File startpath, String endpath) throws Exception {
InputStream is = new FileInputStream(startpath);
int c = is.available();
if (c > 1024 * 1024 * 20) {
}
OutputStream os = new FileOutputStream(new File(endpath));
byte[] buffer = new byte[500];
int length = 0;
while (-1 != (length = is.read(buffer, 0, buffer.length))) {
os.write(buffer);
}
os.close();
is.close();
}