0

In a content type have a field image upload.its image upload type is jpg,png,gif. When we upload these image type of images an error is coming :

The selected file Chrysanthemum.jpg could not be uploaded. The file is not a known image format.

But its running in local not in server. What is the problem ? Please help me. Thanks

0

Below are the two ways. I hope help you to solve your issue.

1. Your files via FTP into the image_import directory aren't being given the correct permissions. You have to provide the permission i.e. chmod 660 * on them in the image_import directory the files were recognized correctly and the import worked.

OR

2. In /includes/image.inc, change line 117 from:

  if (!is_file($file)) {

to:

if (!is_file($file) && !is_uploaded_file($file)) {

Then check is your issue is solved or not. If not then try once updating below with second way :

On the admin/settings/file-system, try changing C:\WINDOWS\Temp to sites/default/files/temp (also made sure it was writeable by the web server).

0

Have you tried with other images? Do you get the same error with other .jpg files? Or .gif files? Perhaps Chrysanthemum.jpg is a corrupt file.

Can you upload other files? Are /tmp permissions set correctly?

If so, it could be a PHP issue, and not a Drupal issue. Check whether the FileInfo module is installed:

pecl install fileinfo

Or if you run Apache, check if the libjpeg.so module is enabled.

  • i tried but got same error. – Rahul lodhi Jun 8 '15 at 8:50
  • I amended my answer with more detail, see if that helps. – Wouter Jun 9 '15 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.