Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6664351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:36:03+00:00 2026-05-26T02:36:03+00:00

Here is my code: String mixtapefilename = testzip.zip; String zipname = mixtapefilename; String path

  • 0

Here is my code:

String mixtapefilename = "testzip.zip";
String zipname = mixtapefilename; 
        String path = Environment.getExternalStorageDirectory() + "/download/";              
        unpackZip(path, zipname);

private boolean unpackZip(String path, String zipname)
{       
     InputStream is;
     ZipInputStream zis;
     try 
     {
         is = new FileInputStream(path + zipname);
         zis = new ZipInputStream(new BufferedInputStream(is));          
         ZipEntry ze;

         while ((ze = zis.getNextEntry()) != null) 
         {
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             byte[] buffer = new byte[1024];
             int count;

             // zapis do souboru
             String filename = ze.getName();
             FileOutputStream fout = new FileOutputStream(path + filename);

             // cteni zipu a zapis
             while ((count = zis.read(buffer)) != -1) 
             {
                 baos.write(buffer, 0, count);
                 byte[] bytes = baos.toByteArray();
                 fout.write(bytes);             
                 baos.reset();
             }

             fout.close();               
             zis.closeEntry();
         }

         zis.close();
         Toast toast = Toast.makeText(getApplicationContext(),"Download Complete", Toast.LENGTH_LONG);
         toast.show();
     } 
     catch(IOException e)
     {
         ProgressDialog dialog;
         dialog = new ProgressDialog(Download.this);                
         dialog.setMessage(e.toString());
         dialog.show();

         return false;
     }

    return true;
}

And my error is: /mnt/sdcard/download/testzip/testzip.mp3 (No such file or directory)

So it can’t find my MP3? But it is supposed to be unzipping my mp3, do I somehow need to create the directories first?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:36:04+00:00Added an answer on May 26, 2026 at 2:36 am

    Yes, you have to create necessary files and directory first before you do unzipping. I believe your sd card already have download directory in it. If so, try this code below. Feel free to adjust to your need.

        private boolean unpackZip(String path, String zipname){       
         InputStream is;
         ZipInputStream zis;
         try 
         {
             is = new FileInputStream(path + zipname);
             zis = new ZipInputStream(new BufferedInputStream(is));          
             ZipEntry ze;
    
             while ((ze = zis.getNextEntry()) != null) 
             {
                 ByteArrayOutputStream baos = new ByteArrayOutputStream();
                 byte[] buffer = new byte[1024];
                 int count;
    
                 // zapis do souboru
                 String filename = ze.getName();
         File innerFile = new File(path, fileName);
    
                 if (ze.isDirectory()) {
            Log.d("DEBUG", "The Entry is a directory..");
            innerFile.mkdirs();
         } else {
                 FileOutputStream fout = new FileOutputStream(path + filename);
    
                 // cteni zipu a zapis
                 while ((count = zis.read(buffer)) != -1) 
                 {
                     baos.write(buffer, 0, count);
                     byte[] bytes = baos.toByteArray();
                     fout.write(bytes);             
                     baos.reset();
                 }
    
                 fout.close();               
                 zis.closeEntry();
             }
    
             zis.close();
             Toast toast = Toast.makeText(getApplicationContext(),"Download Complete", Toast.LENGTH_LONG);
             toast.show();
           }
         } 
         catch(IOException e)
         {
             ProgressDialog dialog;
             dialog = new ProgressDialog(Download.this);                
             dialog.setMessage(e.toString());
             dialog.show();
    
             return false;
         }
    
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the code: string name = myName; int id = (int)_myDB.ThingTable.Where(thing => thing.ThingName ==
Here is the code: string str; cin>>str; cout<<first input:<<str<<endl; getline(cin, str); cout<<line input:<<str<<endl; The
In the following code: public class A { public A():this(null){} public A(string b){/*code here*/}
I'm writing a lexer in haskell. Here's the code: lexer :: String -> [Token]
Here is my code : public static void main(String[] args) { // System.setProperty( //
Here's the code snippet: public static void main (String[]arg) { char ca = 'a'
Here is my code: class Soldier { public: Soldier(const string &name, const Gun &gun);
Here is my code for finding a sequence in a string and replacing it
Here is a portion of my code: var styles:String = .keyword{color: #ff0000;} .comment{color: #00ff00;};
Here's the code I have: var commandsBuffer = List[String]() commandsBuffer ::= cmd.exe commandsBuffer ::=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.