pull/330/head
AriaLyy 8 years ago
parent 42c374e275
commit 946aade387
  1. 5
      Aria/src/main/java/com/arialyy/aria/core/upload/UploadUtil.java
  2. 4
      app/src/main/java/com/arialyy/simple/upload/UploadActivity.java

@ -122,8 +122,8 @@ final class UploadUtil implements Runnable {
}
private void fail() {
mWriter.flush();
mWriter.close();
//mWriter.flush();
//mWriter.close();
mListener.onFail();
}
@ -180,6 +180,7 @@ final class UploadUtil implements Runnable {
}
mOutputStream.flush();
mOutputStream.close();
inputStream.close();
mWriter.append(LINE_END);
mWriter.flush();

@ -45,11 +45,11 @@ public class UploadActivity extends BaseActivity<ActivityUploadMeanBinding> {
break;
case RUNNING:
int p = (int) (task.getCurrentProgress() * 100 / task.getFileSize());
L.d(TAG, "p ==> " + p);
mPb.setProgress(p);
break;
case COMPLETE:
T.showShort(UploadActivity.this, "上传完成");
mPb.setProgress(100);
break;
}
}
@ -62,7 +62,7 @@ public class UploadActivity extends BaseActivity<ActivityUploadMeanBinding> {
@OnClick(R.id.upload) void upload() {
Aria.upload(this)
.load(FILE_PATH)
.setUploadUrl("http://172.18.104.50:8080/UploadActivity/sign_file")
.setUploadUrl("http://172.18.104.50:8080/upload/sign_file")
.setAttachment("file")
.start();
}

Loading…
Cancel
Save