*/
function createFrom($file, $filename=false)
{
- print_r('createfrom');exit;
// copy the file into the storage area..
if (!file_exists($file) || !filesize($file)) {
return false;
function onUploadWithTbl($tbl, $fld)
{
- print_r('onUploadWithTbl');
if ( $tbl->__table == 'Images') {
return; // not upload to self...
}
/// ctrl not used??
function onUpload($roo)
{
- print_r('onUPload');
// echo $_FILES['imageUpload']['type'];exit;
if (empty($_FILES['imageUpload']['tmp_name']) ||
empty($_FILES['imageUpload']['name']) ||
if (!empty($mime_like)) {
$c->whereAdd("Images.mimetype LIKE '". $c->escape($mime_like) ."'");
}
+ $c->orderBy('created DESC');
return $c->fetchAll();
}
$fc = $this->toFileConvert();
// print_r($size);
// exit;
- $fc->convert($this->mimetype, $size);
+ $mt = $this->mimetype;
+ if (!preg_match('#^image/#i',$mt)) {
+ $mt = 'image/jpeg';
+ }
+ $fc->convert($mt, $size);
return $baseURL . $provider . "/$size/{$this->id}/{$this->filename}";
}