I would like to make a WS in Moodle to upload a zip file and unzip internally, which only create files that are inside the zip in a course provided.
I have been searching in Internet and at the code of Moodle, but I didn't found anything that serves me.
I'm a little bit familiar with the structure of the WS in Moodle because I have made 3 very simple WS and I know how to upload files more or less, but I don't know how to do the unzip in moodle.
If anyone knows how to do it or have any examples or documentation that may be useful, it would be helpful.
Thanks in advance.
Have a look at get_file_packer
$packer = get_file_packer('application/zip');
$files = $packer->extract_to_pathname('zipfile.zip', $zipdir);