KissGallery
Posted: Thu Dec 11, 2008 10:38 am
Hi I have installed KissGallery 4 plugin on cmsimple 3.2
.
When enver I want to upload the picture I get error "Wrong extension in "
this is the error catcher in admin.php
if (!(preg_match($ext, $file_name))) $e.='<li>'.$tx['error']['wrongext'].' '.$file_name.'</li>';
I took a look at the code and I saw that variable file_name is always empty
.
$files=kissRFile($fnfile);
if ($action=='save_file') {
$order=kissGetNumber(kissGetVar('order'));
$file_name=kissGetVar('file_name');
$desc=strtr(kissGetVar('desc'),"#","_");
if ($id==0) {
$file_name = strtolower($GLOBALS['HTTP_POST_FILES']['file_name']['name']);
if ($desc=='') $desc=$file_name;
if ($order=='') $order=time();
$file_size = $GLOBALS['HTTP_POST_FILES']['file_name']['size'];
$file_tmp = $GLOBALS['HTTP_POST_FILES']['file_name']['tmp_name'];
$file_type = $GLOBALS['HTTP_POST_FILES']['file_name']['type'];
$ext='/\\'.str_replace(',','|\\',$plugin_cf['kissgallery']['file_extension']).'/i';
if (!(preg_match($ext, $file_name))) $e.='<li>'.$tx['error']['wrongext'].' '.$file_name.'</li>';
if ($file_size > $plugin_cf['kissgallery']['max_filesize']) $e .= '<li>'.$file_name.' '.$tx['error']['tolarge'].' '.$plugin_cf['kissgallery']['max_filesize'].' '.$tx['files']['bytes'].'</li>';
if (!$e) {
$id=kissNextID($files);
if (getImage($file_tmp,$id,$filepath)) {
$o .= '<p>'.ucfirst($tx['filetype']['file']).' '.$file_name.' '.$tx['result']['uploaded'].'</p>';
$file_datetime=time();
$files[]=array($id,$order,$gid,$file_name,$file_datetime,$file_type,$desc);
}
else e('cntsave', 'file', $file_name);
}
} else {
foreach ($files as $num => $rec) {
if ($rec[0]==$id) {
$files[$num][1]=$order;
$files[$num][2]=$gid;
$files[$num][6]=$desc;
}
}
}
kissWFile($fnfile,$files);
$files=kissRFile($fnfile);
}
Did any one have same problem
.
When enver I want to upload the picture I get error "Wrong extension in "
this is the error catcher in admin.php
if (!(preg_match($ext, $file_name))) $e.='<li>'.$tx['error']['wrongext'].' '.$file_name.'</li>';
I took a look at the code and I saw that variable file_name is always empty
.
$files=kissRFile($fnfile);
if ($action=='save_file') {
$order=kissGetNumber(kissGetVar('order'));
$file_name=kissGetVar('file_name');
$desc=strtr(kissGetVar('desc'),"#","_");
if ($id==0) {
$file_name = strtolower($GLOBALS['HTTP_POST_FILES']['file_name']['name']);
if ($desc=='') $desc=$file_name;
if ($order=='') $order=time();
$file_size = $GLOBALS['HTTP_POST_FILES']['file_name']['size'];
$file_tmp = $GLOBALS['HTTP_POST_FILES']['file_name']['tmp_name'];
$file_type = $GLOBALS['HTTP_POST_FILES']['file_name']['type'];
$ext='/\\'.str_replace(',','|\\',$plugin_cf['kissgallery']['file_extension']).'/i';
if (!(preg_match($ext, $file_name))) $e.='<li>'.$tx['error']['wrongext'].' '.$file_name.'</li>';
if ($file_size > $plugin_cf['kissgallery']['max_filesize']) $e .= '<li>'.$file_name.' '.$tx['error']['tolarge'].' '.$plugin_cf['kissgallery']['max_filesize'].' '.$tx['files']['bytes'].'</li>';
if (!$e) {
$id=kissNextID($files);
if (getImage($file_tmp,$id,$filepath)) {
$o .= '<p>'.ucfirst($tx['filetype']['file']).' '.$file_name.' '.$tx['result']['uploaded'].'</p>';
$file_datetime=time();
$files[]=array($id,$order,$gid,$file_name,$file_datetime,$file_type,$desc);
}
else e('cntsave', 'file', $file_name);
}
} else {
foreach ($files as $num => $rec) {
if ($rec[0]==$id) {
$files[$num][1]=$order;
$files[$num][2]=$gid;
$files[$num][6]=$desc;
}
}
}
kissWFile($fnfile,$files);
$files=kissRFile($fnfile);
}
Did any one have same problem