fix uploader
This commit is contained in:
parent
2645cd33b1
commit
ac2b4408a1
1 changed files with 10 additions and 9 deletions
|
@ -54,6 +54,7 @@ public class Uploader extends AppCompatActivity {
|
|||
ProgressBar simpleProgressBar;
|
||||
String[] filename;
|
||||
long filesize;
|
||||
File ufile;
|
||||
private static final long MAX_SINGLE_PART_UPLOAD_BYTES = 5 * 1024 * 1024;
|
||||
|
||||
@Override
|
||||
|
@ -99,6 +100,10 @@ public class Uploader extends AppCompatActivity {
|
|||
simpleProgressBar.setVisibility(View.VISIBLE);
|
||||
fileUpload.setEnabled(false);
|
||||
fileUpload.setText(getResources().getString(R.string.wait));
|
||||
Thread uploadFile = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (fprefix.getText().toString().endsWith("/") || fprefix.getText().toString().equals("")) {
|
||||
fkey = fprefix.getText().toString()+filename[filename.length-1];
|
||||
} else {
|
||||
|
@ -107,15 +112,11 @@ public class Uploader extends AppCompatActivity {
|
|||
//System.out.println(fkey);
|
||||
progress = 0;
|
||||
filesize = 0;
|
||||
Thread uploadFile = new Thread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
//Your code goes here
|
||||
//s3client.createBucket(bucket, location);
|
||||
//System.out.println(fkey);
|
||||
File ufile = readContentToFile(fileuri);
|
||||
ufile = readContentToFile(fileuri);
|
||||
filesize = ufile.length();
|
||||
//PutObjectRequest request = new PutObjectRequest(bucket, fkey, ufile);
|
||||
//upload = s3client.putObject(request);
|
||||
|
|
Loading…
Reference in a new issue