box / box-android-sdk

Apache License 2.0
62 stars 68 forks source link

Specific files are truncated when downloaded via box-android-sdk, but can be downloaded successfully just by renaming them #206

Closed paragchandra closed 8 years ago

paragchandra commented 8 years ago

Certain files that I upload to my Box account will get truncated when I attempt to download them via the Android Box SDK. To reproduce this:

  1. Clone the box-android-sdk, remaining on the 'master' branch
  2. Extract the attached archive to find two files.
  3. Upload the included "PYGW_encrypted.csv" file to the root folder of your Box account. Note that it is 1219 bytes in length
  4. Rename "PYGW_encrypted.csv" to "PYGW_encrypted.xlsx" and similarly upload it to the root folder of your Box account
  5. Replace the "MainActivity.java" in the master branch with the one in the attached ZIP file
  6. Edit MainActivity.java to adjust CLIENT_ID, CLIENT_SECRET, and REDIRECT_URL as appropriate.
  7. Build the application via "./gradlew build"
  8. Install the application to an Android device/emulator - I am using a 6.0 x86 emulator
  9. Launch the app and enter credentials for your Box account
  10. Click the "PYGW_encrypted.csv" file to download it, then wait a second or two
  11. adb shell into the device, and "ls -l /data/data/com.box.androidsdk.sample/cache" to see that the file is only 959 bytes in length
  12. Now click the "PYGW_encrypted.xlsx" file to download it, then wait a second or two
  13. adb shell into the device, and "ls -l /data/data/com.box.androidsdk.sample/cache" to see that this file is the correct 1219 bytes in length

Archive.zip

doncung commented 8 years ago

Hi can you try using the baymax branch? We are doing some final rounds of testing and documentation, but we plan to replace master with that branch this week or next. I believe we have fixed this issue in that branch (the error I believe is due to us forgetting to call the getBody method in BoxHttpResponse to handle zip encoding and instead using the stream directly).

paragchandra commented 8 years ago

Yes, switching to baymax branch seems to have fixed it.

paragchandra commented 8 years ago

Random question - we submitted a patch to address Issue #135, and while they are present in "master", I don't see them in the "baymax" branch. Just want to make sure they will be preserved when you replace master with baymax.

doncung commented 8 years ago

Thanks. I believe we made an equivalent fix in the baymax branch so we didn't see the need to cherry pick that. Please let us know however if you run into anything. Our market app uses this branch so it should be fairly stable.

On Oct 12, 2016 6:32 PM, "paragchandra" notifications@github.com wrote:

Random question - we submitted a patch to address Issue #135 https://github.com/box/box-android-sdk/issues/135, and while they are present in "master", I don't see them in the "baymax" branch. Just want to make sure they will be preserved when you replace master with baymax.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/box/box-android-sdk/issues/206#issuecomment-253386175, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmHYjB8wP6VWx4vpCKwSHkU9yCZmpApks5qzYo4gaJpZM4KVQM0 .

paragchandra commented 8 years ago

Looking for help with Issue #183:

https://github.com/box/box-android-sdk/issues/183

Not sure if this is the right channel, but as it was suggested that I use the "baymax" branch, and this problem was not occurring on the 3.0.3 branch, I figured I would reach out. Thanks in advance.

On Wed, Oct 12, 2016 at 11:36 PM doncung notifications@github.com wrote:

Thanks. I believe we made an equivalent fix in the baymax branch so we didn't see the need to cherry pick that. Please let us know however if you run into anything. Our market app uses this branch so it should be fairly stable.

On Oct 12, 2016 6:32 PM, "paragchandra" notifications@github.com wrote:

Random question - we submitted a patch to address Issue #135 https://github.com/box/box-android-sdk/issues/135, and while they are present in "master", I don't see them in the "baymax" branch. Just want to make sure they will be preserved when you replace master with baymax.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/box/box-android-sdk/issues/206#issuecomment-253386175>, or mute the thread < https://github.com/notifications/unsubscribe-auth/AAmHYjB8wP6VWx4vpCKwSHkU9yCZmpApks5qzYo4gaJpZM4KVQM0

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/box/box-android-sdk/issues/206#issuecomment-253404964, or mute the thread https://github.com/notifications/unsubscribe-auth/AIbKYBUgwrtSLIataMQQuxZvuS7uT5E1ks5qzadagaJpZM4KVQM0 .

doncung commented 8 years ago

I've answered Issue #208 :

https://github.com/box/box-android-sdk/issues/208

I'm closing this since the new branch is working for you.