Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

New Ultimate Edition (multistore) can't upload images Rate Topic   * * * * * 1 votes

 
  • chendwww
  • Junior Member
  • Members
  • Join Date: 29-May 10
  • 3 posts

Posted 14 January 2012 - 02:34 AM #1

Hi Everyone

We installed a beta Ultimate Edition on our server, imported database from exsiting website and try to see if it works. However, we found we have troubles to upload new images

When we upload an image, the system shows a blank page and the image will not display. We tried to upload by local, url, and server methods, none of them works

Our technical team run the beta version on local computer and find this error:

Fatal error: Call to undefined function mime_content_type() in D:\WWW\www\cscart_multistore\core\fn.fs.php on line 743

We wonder if anyone has similar issue or knows how to solve it. We tired to open a ticket on cs-cart's system, but they replied:

"Unfortunately, we do not support beta versions. Our engineers fix bugs in them. A new RC version will be released soon. I advise you to look into our blog: http://blog.cs-cart.com"

There is nothing related with this bug on the blog :-( :-( :-(

 
  • jrchew
  • Newbie
  • Trial users
  • Join Date: 25-Jan 12
  • 8 posts

Posted 25 January 2012 - 08:51 PM #2

I solved this error by adding this function to core/fn.fs.php.

function mime_content_type($filename) {
return 'image/jpg';
}


That function is a terrible hack because it assumes every uploaded image is a jpeg but it works until this bug is fixed. I haven't had any adverse issues.. yet.

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11357 posts

Posted 26 January 2012 - 05:28 AM #3

It shouldn't be calling that function. The code clearly checks to see if the function exists or not before calling it:
	    if (empty($type) && function_exists('mime_content_type')) {
			    $type = @mime_content_type($filename);
	    }
So unless it exists, it should not be being called.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • jrchew
  • Newbie
  • Trial users
  • Join Date: 25-Jan 12
  • 8 posts

Posted 27 January 2012 - 05:03 PM #4

I'm currently testing out the latest cs-cart ultimate beta and couldn't find anything within fn.fs.php that checked for the existance of the function mime_content_type

I hope that they find a new way to check mime types as the mime_content_type function is deprecated.

 
  • elfingo
  • Newbie
  • Members
  • Join Date: 22-Dec 11
  • 1 posts

Posted 20 February 2012 - 11:00 AM #5

if(!function_exists("mime_content_type"))
{
function mime_content_type($file)
{
$open_bit = finfo_open(FILEINFO_MIME_TYPE);
return finfo_file($open_bit, $file);
}
}


The above function (FileInfo) is a PECL extension and is encouraged by PHP To use as an alternative.
You need fileinfo extention at your server.