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

  • SEARCH
  • Home
  • 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 6208643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:50:34+00:00 2026-05-24T05:50:34+00:00

I have a project where the user can add multiple files to a cart

  • 0

I have a project where the user can add multiple files to a cart and then zip them into a single file and download all of them at once.

It seems though that as soon as the cart gets bigger then 10mb it cannot create the zip file.
I thought this might be because of upload_max_filesize, but that is set to 200m and same for post_max_size.

What would be limiting this?

Here is my code.
It creates a random file name, then checks the cart loop and adds each file.

    // create object
$zip = new ZipArchive();

$filename = "loggedin/user_files/ABX-DOWNLOAD-".rand(1, 1000000).".zip"; 

while (file_exists($filename)):                   
    $filename = "loggedin/user_files/ABX-DOWNLOAD-".rand(1, 1000000).".zip"; 
endwhile;      


// open archive 
if ($zip->open('../'.$filename, ZIPARCHIVE::CREATE) !== TRUE) {
    die ("Could not open archive");
}


// add files
//echo $all_audio;

    foreach($audio_ids as $audio_id){
        if($audio_id != ""){
            $audio = Audio::find_by_id($audio_id);
            $selected_category        = Categories::find_by_id($audio->category_id);
            $selected_sub_category    = Sub_Categories::find_by_id($audio->sub_category_id);
            $selected_sub_sub_category    = Sub_Sub_Categories::find_by_id($audio->sub_sub_category_id);

            $f = "uploads/mp3/".$selected_category->category_name."/".$selected_sub_category->sub_category_name."/".$selected_sub_sub_category->sub_sub_category_name."/".$audio->media_path; 
             $zip->addFile($f) or die ("ERROR: Could not add file: $f");  

        }
    }

// close and save archive
$zip->close() or die("ERROR: COULD NOT CLOSE");
 }
  • 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-24T05:50:34+00:00Added an answer on May 24, 2026 at 5:50 am

    Well, narrowed it down. A pathname was corrupted and was making the zip error out because the file did not exist. Looks like I need some better error checking.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working a project currently in which the user can add multiple news
I have created multiple user controls in my project and what I need to
My model consists of a single main object that the user can add various
I have a project where the requirements is that a end user will select
I have to start a new project where user authentication/management will be required. A
I have a project to create a program, which prevents the user from escaping
I have a Project model similar to: class Project(models.Model): ... lead_analyst=models.ForeignKey(User, related_name='lead_analyst') ... I
I have a Winforms project with a bunch of User controls. I'd like the
I’m working on a project and have developed the high level user requirements for
I have a scene in my WPF project with about 2000 different user controls:

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.