cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: ANDROID - zip file problem

Greg-DB
Dropboxer

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

Re: ANDROID - zip file problem

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
Who's talking

Top contributors to this post

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