Welcome Guest, Not a member yet? Register   Sign In
Zip: Unexpected end of archive
#2

[eluser]Unknown[/eluser]
I believe I've found the problem with this and have reworked it to create a file on the server using zip->archive() instead.

Would I be right in thinking that the problem above can be caused when other data is sent to the header in addition to the zip->download() request? In other words, my code is basically like this:

Code:
function form()
{
  // Has form been submitted?
  if ($this->input->post('submit_button') !== FALSE)
  {
    // Validating and processing data...

    $this->zip->download('archive.zip');
  }

  // Fill data variable...

  $this->parser->parse('form', $data);
}

Because the form page is parsed after the ZIP has been downloaded, the header will be incorrect for the ZIP file. Not well explained, but I'd appreciate it if someone could confirm my reason.


Messages In This Thread
Zip: Unexpected end of archive - by El Forum - 02-10-2011, 08:20 AM
Zip: Unexpected end of archive - by El Forum - 02-10-2011, 08:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB