Home >Backend Development >PHP Problem >How to solve the problem of decompression error of zip file generated by php
Solution to the decompression error when php generates a zip file: First use ultraedit to view the zip file downloaded from the server; then set the "Content-Length" to a longer value.
Recommended: "PHP Video Tutorial"
Specific questions:
Me Compress the folder into a zip. After compression, it needs to be downloaded to the local machine. It is normal to decompress the zip file on the server. However, if the zip file downloaded to the local machine contains pictures or PDF files, it cannot be decompressed, saying that the file is damaged. This is What should I do?
Solution:
Use ultraedit to check the server and the downloaded zip file. 00 00 00 is missing at the end. Change the Content-Length It would be better to make it a little longer.
The above is the detailed content of How to solve the problem of decompression error of zip file generated by php. For more information, please follow other related articles on the PHP Chinese website!