note 116238 added to ziparchive.addemptydir

From: Date: Fri, 28 Nov 2014 01:25:10 +0000
Subject: note 116238 added to ziparchive.addemptydir
Groups: php.notes 
Request: Send a blank email to php-notes+get-201030@lists.php.net to get a copy of this message
On PHP >5.4, This function will create a file, not a directory. For instance: $zip->addEmptyDir ( 'path/to/dir/' ); will create the folders "path/", and "path/to/", and a dummy 0-byte file named "dir" in the latter. If then we add a file to that dir, say like this: $zip->addFromString ( 'path/to/dir/file.txt', $data ); the result will be a SEPARATE folder named "dir" next to the dummy "dir" file. The "dir" folder will contain the file "file.txt". This was tested on an APACHE server running PHP 5.4 ---- Server IP: 72.52.91.14 Probable Submitter: 149.78.48.164 ---- Manual Page -- http://php.net/manual/en/ziparchive.addemptydir.php Edit -- https://master.php.net/note/edit/116238 Del: integrated -- https://master.php.net/note/delete/116238/integrated Del: useless -- https://master.php.net/note/delete/116238/useless Del: bad code -- https://master.php.net/note/delete/116238/bad+code Del: spam -- https://master.php.net/note/delete/116238/spam Del: non-english -- https://master.php.net/note/delete/116238/non-english Del: in docs -- https://master.php.net/note/delete/116238/in+docs Del: other reasons-- https://master.php.net/note/delete/116238 Reject -- https://master.php.net/note/reject/116238 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#201030) next »