Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file corrupt #30

Closed
ifba opened this issue Aug 15, 2016 · 3 comments
Closed

file corrupt #30

ifba opened this issue Aug 15, 2016 · 3 comments

Comments

@ifba
Copy link

ifba commented Aug 15, 2016

hi,
i have encrypted file,
while download multiple file, before add to zip i will decrypt the file. I have 3 file, i sucessfully created the zip, but only one file can be read other are corrupted
apache version 2.4
php 5.5
windows 10

foreach ($fileid as $key => $value) {
$file_info      = $this->CI->pd_files_mdl->getFileById( $value );
            $zip->init_file_stream_transfer($file_info->name, $file_info->unencrypted_size);
$stream = fopen($userStorage.'/'.$file_info->path,'r');
            if ( $file_info->encrypted == 1 ){
                while (!feof($stream)) {
                    $buffer = fread($stream, 1024 * 1024);
                    $data = $aesCipher->decrypt($buffer);
                                $zip->stream_file_part($data);
                  } 
                $zip->complete_file_stream();   
                        }
}

        $zip->finish();
@johnmaguire
Copy link
Contributor

@ifba How large is the resulting ZIP file? Possible dupe of #12.

@ifba
Copy link
Author

ifba commented Oct 12, 2016

HI, sorry for the late update,
the issue already solve, it not because of this library but my encryption library.

thank you

@ifba ifba closed this as completed Oct 12, 2016
@johnmaguire
Copy link
Contributor

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants