Jump to content

creating zip archive (set default path?)


DamienRoche

Recommended Posts

I am trying to create a zip archive.

 

Currently, I have:

 

$zip = new ZipArchive();
$zipname = "$newcore.zip";

if ($zip->open($zipname, ZIPARCHIVE::CREATE)!==TRUE) {
   exit("cannot open <$zipname>\n");
}

$zip->addFile($absolute_path, $passportfile);

$zip->close();

 

The $absolute_path is where the passport file is on the server. The passport file uploads fine. Then I just want to put this passport file into a zip.

 

No errors are coming up, though I'm not using php error reporting. But that doesn't matter right now.

 

All I want to know is where should the zip be created? and can I set the default path?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/124178-creating-zip-archive-set-default-path/
Share on other sites

though I'm not using php error reporting. But that doesn't matter right now.

It does matter. When learning php (or trying something new), developing php code, or debugging php code, you should have error_reporting set to E_ALL and display_errors set to ON in your php.ini (stop and start your web server to get any changes made to php.ini to take effect) to get php to help you.

 

I turned on error reporting, though I am getting errors, I'm not getting anything on this..?

How did you turn on error reporting (show the settings you used) and if you did this in your php.ini, did you stop and start your web server to get any changes made to php.ini to take effect?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.