android - TransferManager upload doesn't actually upload file -
i'm trying follow tutorial uploading file s3 from android sdk, outlined here. after verifying able create cognitocachingcredentialsprovider, tried execute upload device s3 bucket set up. have following code attempt this:
cognitocachingcredentialsprovider credentialsprovider = new cognitocachingcredentialsprovider( context, identityprovider, null, {autarn}); log.d("logtag", "my id " + credentialsprovider.getidentityid()); //shows me identityid; credentialsprovider valid transfermanager transfermanager = new transfermanager(credentialsprovider); file file = new file("/storage/sdcard0/download"); upload upload = transfermanager.upload({bucket name}, "test.txt", file); while (upload.isdone() == false) { system.out.println(upload.getprogress().getpercenttransferred() + "%"); }
the while loop shows me 0% of file has been uploaded, , indeed file not show expected in target bucket. have clue why file isn't being uploaded intended?
there error of sort, can turn on request logging , see if see response errors in logs?
adb shell setprop log.tag.com.amazonaws.request debug
and in code:
java.util.logging.logger.getlogger("com.amazonaws.request").setlevel(java.util.logging.level.finest);
one thing double check setup s3 bucket permissions correctly: http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/s3transfermanager.html#set-permissions-on-the-bucket
Comments
Post a Comment