How to solve the problem that codeigniter cannot correctly identify the image type when uploading images

Source: Internet
Author: User
Tags codeigniter
Codeigniter cannot correctly identify the image type when uploading images. codeigniter uploads images. The solution to the problem that codeigniter cannot correctly identify the image type when uploading images. codeigniter uploads images in jpg format when uploading images using codeigniter, codeigniter cannot identify Image types correctly when uploading images. Solution: codeigniter uploads images

Codeigniter is used to upload images in jpg format, but ci is always recognized as application/octet-stream, which leads to upload failure, the solution is as follows:

Enable the fileinfo extension in php. ini to obtain the correct type:

The code is as follows:

// Windows
Extension = php_fileinfo.dll

// Linux
Extension = fileinfo. so

Note: about fileinfo

The alternative function of mime_content_type () officially recommended by PHP is the Fileinfo function. PHP 5.3.0 + supports the Fileinfo support-enabled function by default. you can use finfo_open () to determine the object MIME type without any configuration. The default LAMP environment php version installed in Centos is PHP5.2.6. if it is earlier than 5.3.0, a similar error may occur: PHP Fatal error: Call to undefined function finfo_open () in .... In the previous php version, the magic_open class needs to be loaded. the fileinfo function belongs to the PECL extension, and the fileinfo PECL extension can be enabled.

ACDSEE80 cannot recognize Image File types

I don't know if this can solve the problem. please try:

1. Choose Start> Control Panel> add/delete to delete the current ACDSEE program;

2. enter "regedit" in "start"> "run" and press enter to enter the registry editor;

3. click "My Computer" and press the shortcut key "Ctrl + F" to go to the search page;

4. enter "acdsee" in the search dialog box to delete all relevant content. (Note: Before deleting a registry, use "File-> Export" to back up the registry, after deletion, search again to confirm that the deletion is clean)

3. close the registry editor and use "Super Rabbit" to clear the registry and hard disk (delete all acdsee-related installation files, including hidden files)

4. restart the system and install the official ACDSEE software package. (It is recommended that you do not use beta and trial versions that are down from some small websites. There may be bugs. In addition, do not use Chinese versions as much as possible, which is also prone to problems. we strongly recommend you use a mature and stable version, most of the latest versions have bugs)

Wish you a smooth solution :)

Why can't pictures uploaded from a computer to a mobile phone be recognized by mobile phones?

File Format. jpg or gif may be bmp ......

When using the codeigniter Upload class to upload images, the image is in jpg format ,...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.