I have created zip files using shell_exec function. I am trying to rename files from created zip using shell_exec function. Any idea about it?
Asked
Active
Viewed 610 times
-2
-
From the documentation: `shell_exec — Execute command via shell and return the complete output as a string`... just use the server to rename it. Linux and Windows rename commands will differ – Bonatti Dec 22 '15 at 10:31
-
4Possible duplicate of [Rename multiple files shell](http://stackoverflow.com/questions/6911301/rename-multiple-files-shell) – Bonatti Dec 22 '15 at 10:32
3 Answers
0
I have solved problem using following command shell_exec('printf "@ old_file_name.pdf\n@=new_file_name.pdf\n" | zipnote -w '.$zip_name);

Digambar
- 9
- 6
0
You can do it like this.
Create zip file: shell_exec('zip -j myzip.zip old_file_name.pdf');
Rename created zip file: shell_exec('printf "@ old_file_name.pdf\n@=new_file_name.pdf\n" | zipnote -w '.myzip.zip);

Digambar
- 9
- 6