Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that Codeigniter cannot upload rar and zip compressed packages

Shulou Source: shulou.com Published: 2022-06-03 11:27:16 11月15日 Update

This article mainly introduces "how to solve the problem that Codeigniter cannot upload rar and zip compressed packages". In daily operation, I believe many people have doubts about how to solve the problem that Codeigniter cannot upload rar and zip compressed packages. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer "how to solve the problem that Codeigniter cannot upload rar and zip compressed packages". Next, please follow the editor to study!

Codeigniter's format restrictions when uploading files are defined in the mimes.php file in config under the application folder. This file does not contain rar by default, and the definition of zip cannot upload a compressed package. We can solve this problem by adding the following code to the class:

The copy code is as follows:

"zip" = > array ("application/x-zip", "application/zip", "application/x-zip-compressed", "application/octet-stream"), / / originally only the first three items

"rar" = > array ("application/octet-stream"), / / there is no such item as rar at all. The whole item is added by yourself.

At this point, the study on "how to solve the problem that Codeigniter cannot upload rar and zip packages" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Questions files learning code more help practical next only folders articles methods are in fundamental format theory knowledge articles websites materials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Shulou Tech Info Linux MariaDB