ziparchive

ZipArchive not opening file - Error Code: 19

隐身守侯 提交于 2019-11-30 08:36:15
问题 Im having issues with my code being able to open a zip file that i have uploaded and moved into a folder, the zip file uploads fine and you can open it in any Zip program however, when i attempt to open it with ZipArchive to extract the data it errors. $path = "../"; // Upload directory $count = 0; foreach ($_FILES['files']['name'] as $f => $name) { if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path . $name)) $count++; // Number of successfully uploaded file } $kioskFile = $_FILES[

Php create zip file (from post attachments wordpress)

回眸只為那壹抹淺笑 提交于 2019-11-30 05:30:04
问题 I am trying to create a zip file from post attachments in wordpress . I have tried both methods below - but it results in nothing (No error messages , no file created) - What am I doing wrong (again .. ) I do not think that The fact that those are post attachments in wordpress has anything to do with it - because those methods failed also with normal files . why ? --> See the answer . $files_to_zip = array();// create files array //run a query $post_id = get_the_id(); $args = array( 'post

zipArchive open error in PHP

☆樱花仙子☆ 提交于 2019-11-29 16:36:15
Cannot create zip archive in PHP, always returns ZIPARCHIVE::ER_MULTIDISK $fileName=$_SERVER['DOCUMENT_ROOT'].'/temp/temp.zip'; $zip = new ZipArchive(); $err=$zip->open($fileName,ZipArchive::CREATE); $zipFileFunctionsErrors = array(0=>'OK', ZIPARCHIVE::ER_MULTIDISK => 'Multi-disk zip archives not supported.', ..., ... ); echo $zipFileFunctionsErrors[$err]; $zip->addFromString('empty.txt', ''); $zip->close(); Outputs Multi-disk zip archives not supported zip file didn't created on local machine code works good I think that your issue has to be something with the php version, sounds like it's

PHP Aborting when creating large .zip file

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 09:55:08
My php script running on CentOS 5.6 and PHP 5.2.12 using ZipArchive() and successfully creates .zip files over 1.6Gb but not for a larger archive of 2GB or larger - PHP aborts with no apparent error. Nothing in the PHP error log or stderr. The script is being executed at the cmd line and not interactively. The script runs for about 8min and the temp archive grows and while checking the filesize, the last listing showed the tmp file was 2120011776 in size and then the tmp file disappears and the PHP script falls thru the logic and executes the code after the archive create. For some reason top

ZipArchive not opening file - Error Code: 19

荒凉一梦 提交于 2019-11-29 07:09:24
Im having issues with my code being able to open a zip file that i have uploaded and moved into a folder, the zip file uploads fine and you can open it in any Zip program however, when i attempt to open it with ZipArchive to extract the data it errors. $path = "../"; // Upload directory $count = 0; foreach ($_FILES['files']['name'] as $f => $name) { if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $path . $name)) $count++; // Number of successfully uploaded file } $kioskFile = $_FILES['files']['name'][0]; $kioskFile = explode(".", $kioskFile); $kioskFile = $kioskFile[0]; $zipFile = "../

PHP ZipArchive non-English filenames return funky filenames within archive

懵懂的女人 提交于 2019-11-29 05:23:25
This code works properly to make the ZIP file with the wanted files, except the filenames in the archive, which are not in English (in this case they are Hebrew), have weird characters instead of the proper hebrew letters. <?php $filesfordown = $_POST['GEMin']; if(empty($filesfordown)) { echo "No files were seleceted for download."; } else { $zip_name = "RMW." . time() . ".zip"; $zip = new ZipArchive; $zip->open($zip_name, ZipArchive::CREATE); foreach ($filesfordown as $filefordown) { $zip->addFile($filefordown); } $zip->close(); } header('Content-Type: application/zip'); header("Content

zipArchive open error in PHP

半城伤御伤魂 提交于 2019-11-28 11:24:42
问题 Cannot create zip archive in PHP, always returns ZIPARCHIVE::ER_MULTIDISK $fileName=$_SERVER['DOCUMENT_ROOT'].'/temp/temp.zip'; $zip = new ZipArchive(); $err=$zip->open($fileName,ZipArchive::CREATE); $zipFileFunctionsErrors = array(0=>'OK', ZIPARCHIVE::ER_MULTIDISK => 'Multi-disk zip archives not supported.', ..., ... ); echo $zipFileFunctionsErrors[$err]; $zip->addFromString('empty.txt', ''); $zip->close(); Outputs Multi-disk zip archives not supported zip file didn't created on local

php zipArchive unzip only certain extensions

。_饼干妹妹 提交于 2019-11-28 06:18:45
问题 I'm in need of unziping uploaded content. But for security purposes must verify the files are only image files so that somebody can't add a php into the zip and then run it later. While doing the unzip I need to preseverve the file structure as well. $zip->extractTo($save_path . $file_name, array('*.jpg','*.jpeg','*.png','*.gif') ); doesn't return null. Is there a parameter I can use for this or must I iterate with a loop through the zip file using regex to match extensions and create the

PHP Aborting when creating large .zip file

旧时模样 提交于 2019-11-28 03:16:36
问题 My php script running on CentOS 5.6 and PHP 5.2.12 using ZipArchive() and successfully creates .zip files over 1.6Gb but not for a larger archive of 2GB or larger - PHP aborts with no apparent error. Nothing in the PHP error log or stderr. The script is being executed at the cmd line and not interactively. The script runs for about 8min and the temp archive grows and while checking the filesize, the last listing showed the tmp file was 2120011776 in size and then the tmp file disappears and