In PHP a compressed package upload, I have been able to unzip.
Now how to rename it while extracting it, and put it in another directory?
Please teach the great God.
Unzip the program
$zip = Zip_open ("/php/test/test.zip");
if ($zip) {
while ($zip _entry = Zip_read ($zip)) {
$fp = fopen ("/php/". Zip_entry_name ($zip _entry), ' W ');
if (Zip_entry_open ($zip, $zip _entry, "R")) {
$buf = Zip_entry_read ($zip _entry, zip_entry_filesize ($zip _entry));
Fwrite ($fp, ' $buf ');
Zip_entry_close ($zip _entry);
Fclose ($FP);
}
}
Zip_close ($zip);
}
Ask for the function in the middle plus rename and save to a directory .....
Reply to discussion (solution)
Unzip is unzip, rename is rename
Why do you rub the irrelevant stuff together?
Just do it separately.
Rename the files in the file under another directory when you unzip them.
Unzip is unzip, rename is rename
Why do you rub the irrelevant stuff together?
Just do it separately.
Didn't you put it in another catalogue? "/php/". Zip_entry_name ($zip _entry)
If you want to change the file in the package when you unzip it, at least you have to give a change name rule or a new and old name comparison table?
Understand, the name is only the first five characters and then the suffix name is not changed.
Didn't you put it in another catalogue? "/php/". Zip_entry_name ($zip _entry)
If you want to change the file in the package when you unzip it, at least you have to give a change name rule or a new and old name comparison table?
Zip_entry_name ($zip _entry) Gets the file name in the package
You do this with a string function, just generate the target file name.
Yes, thanks./ui/scripts/csdn/plugin/001/face/63.gif][/img]
I echo "Zip_entry_name ($zip _entry)" came out of an array ah .... What's going on....