Finally, let me find the solution, that is, to implement this function through the PHP program execution function, because there are too many things that can solve ZIP files now (if you do not believe it, you can go to the place where you have downloaded the software to find it, so you will not be disappointed, and I will not be wrong ).
The following is the original file of the program:
# Upload. php Tutorial
The code is as follows: |
Copy code |
<Table border = "0"> <Form ENCTYPE = "multipart/form-data" action = "ups tutorial ave. php" method = "post">
<Tr> <Td> If the file is *. ZIP, it will be automatically decompressed.
<Input name = "MyFile" TYPE = "File" size = "50"> </Td> </Tr> <Tr> <Td colspan = "2" align = "center"> <Input type = "Submit" value = "upload" class = iwhite> <Input type = "reset" value = "Refill" class = iwhite> </Td> </Tr> </Table> |
</Body>
</Html>
The code is as follows: |
Copy code |
<? // Upsave. php // Save the uploaded file $ Filename = "$ MyFile_name "; Copy ($ MyFile, "$ filename "); Unlink ($ MyFile );
// Determine whether the file is a ZIP file $ Expand_name = explode (".", $ filename ); If ($ expand_name [1] = "zip" or $ expand_name [1] = "ZIP ") { $ Str = "pkunzip.exe-e $ filename "; Exec ($ str ); Unlink ($ filename ); }
?> |
I have tested the above programs. You only need to put them on the server, but the directory must have the write permission. There is anotherPkunzip.exeThe file must also be placed in this directory, which is already in the compressed package.