cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ANDROID - zip file problem

ANDROID - zip file problem

DEXIT D.
New member | Level 1

Hello, I making android app with dropbox API and I have a problem. My app zips folder on android device and uploads it on dropbox, it works. If I download zip file from dropbox to my PC, I can extract it but if I download this file using dropbox api method getFile with code below, downloaded zip file is corrupted and archive showing error "end of central directory signature not found"

Here is the code:

protected Boolean doInBackground(Void... params) {

String inPath = Environment.getExternalStorageDirectory() + dropboxFile;
File file=new File(inPath);
FileOutputStream mFos = null;

try {

mFos = new FileOutputStream(file);
} catch (FileNotFoundException e){

return false;
}

try {
dbAPI.getFile("/" + dropboxFile, null, mFos, null);
} catch (DropboxException e) {
e.printStackTrace();
}

return true;
}

Can you help me please?


2 Replies 2

Greg-DB
Dropbox Staff

How are you downloading the file when it does work? Are you using the Dropbox web site? Can you compare the file you get that way to the file you get via the API? E.g., compare the file lengths and/or hashes.

Some other things that would be helpful in debugging this:

- the rest of the relevant code (e.g., what do you do with mFos?)

- any output/errors you get from the code

DEXIT D.
New member | Level 1

Thanks for your reply. I found solution to this, problem was in download progress because the file was not downloaded completely. I've done a few things around and now it works.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    DEXIT D. New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?