We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
DEXIT D.
10 years agoNew member | Level 1
ANDROID - zip file problem
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
Replies have been turned off for this discussion
- Greg-DB10 years ago
Dropbox Community Moderator
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.10 years agoNew 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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!