Upload Feature Error

15 posts by 7 authors in: Forums > CMS Builder
Last Post: October 22, 2012   (RSS)

Re: [Jason] Upload Feature Error

By Djulia - October 5, 2012

Hi Jason

The file is [font "Verdana"]upload[/#000000]ed, but I always have PHP Notice.

Undefined index: channels in upload_functions.php on line 201

An idea?

Thanks again!

Djulia
Hi Djulia,

I think I can see what is causing the problem. Line 201 tries to get the number of channels that an image has, but an SWF file doesn't have any channels.

If you change line 201 from :

if ($imageData['channels'] == 4) { return sprintf(t("File '%s' isn't valid (CMYK isn't browser-safe)."), htmlspecialchars($uploadInfo['name'])); }

to:

if (@$imageData['channels'] == 4) { return sprintf(t("File '%s' isn't valid (CMYK isn't browser-safe)."), htmlspecialchars($uploadInfo['name'])); }

This should fix the problem. Let me know if it doesn't work.

Thanks

Greg
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Upload Feature Error

By Djulia - October 5, 2012

Hi Greg,

It is perfect! Thanks! :)

Djulia

Re: [greg] Upload Feature Error

By InHouse - October 22, 2012

Just a note, but we saw the same issue but not with a. SWF file. It was with a PNG that I think was saved in the CMYK colour-space.
This fix removed the error message and allowed us to save the record.
Thanks to Greg and Jason for this.
J.