mrsburnside Posted August 16, 2010 Share Posted August 16, 2010 This code works: // create object $zip = new ZipArchive(); // open archive if ($zip->open('./download/zipfile.zip', ZIPARCHIVE::CREATE) !== TRUE) { die ("Could not open archive"); } but, I want to create the name of the zip file dynamically. The following code does not work ... doesn't give me an error, just doesn't create the zip file: / / create object $zip = new ZipArchive(); $thisTime = time(); // open archive $thisZip = './download/'.$thisTime.'_download.zip'; $thisZip_b = $thisTime.'_download.zip'; if ($zip->open($thisZip, ZIPARCHIVE::CREATE) !== TRUE) { die ("Could not open archive"); } thanks in advance oh wise ones. mrsburnside Link to comment https://forums.phpfreaks.com/topic/210890-creating-zip-file-dynamically/ Share on other sites More sharing options...
btherl Posted August 16, 2010 Share Posted August 16, 2010 The next things I would try are: 1. Can I create a file with that name manually? 2. Can I create a file called "1281999572_download.zip" without generating it automatically with time(), instead using a static string? 3. If it still doesn't work, try filenames with different lengths and with different character sets in the filenames. Link to comment https://forums.phpfreaks.com/topic/210890-creating-zip-file-dynamically/#findComment-1100009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.