Jump to content

[solved] Cannot Upload Product Images


Recommended Posts

Hello everyone,

 

I have one site running on version 1.3.6, and i'm having trouble upload product images since a while.

 

What happens is, when i search one image and click save, shows no error, just an empty page.

 

In FTP folder the image does not appear.

 

Any help, or direction for what i can do.

 

Thanks!

Link to comment
Share on other sites

okay so it mean that you've got some parse script error related to the php

in this case i suggest you to run store under debug mode, just turn error reporting, then you will probably see some errors instead "blank" page

  • Like 1
Link to comment
Share on other sites

The error:

exec() has been disabled for security reasons in /home/xxxxx/public_html/onlineshop/images.inc.php on line 90

 

Tried changing the permissions of images.inc.php to 777, without sucess

 

Here's Line 90 is:

$mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name'])));

 

Lines 78 to 97:

/* Try 4 different methods to determine the mime type */
if (function_exists('finfo_open'))
{
	$const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
	$finfo = finfo_open($const);
	$mimeType = finfo_file($finfo, $file['tmp_name']);
	finfo_close($finfo);
}
elseif (function_exists('mime_content_type'))
	$mimeType = mime_content_type($file['tmp_name']);
elseif (function_exists('exec'))
{
	$mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name'])));
	if (!$mimeType)
		$mimeType = trim(exec('file --mime '.escapeshellarg($file['tmp_name'])));
	if (!$mimeType)
		$mimeType = trim(exec('file -bi '.escapeshellarg($file['tmp_name'])));
}
if (empty($mimeType) OR $mimeType == 'regular file')
	$mimeType = $file['type'];

Edited by cdaniel.marques (see edit history)
Link to comment
Share on other sites

Looks like exec() function was disabled on your server, in such cases, it's unlikely the host will enable it.

 

Try deleting the following part of the code

elseif (function_exists('exec'))
       {
               $mimeType = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name'])));
               if (!$mimeType)
                       $mimeType = trim(exec('file --mime '.escapeshellarg($file['tmp_name'])));
               if (!$mimeType)
                       $mimeType = trim(exec('file -bi '.escapeshellarg($file['tmp_name'])));
       }

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...