solidly in my multi-user admin system. I have chosen to save the data
outside of the cakePHP admin section for this specific project. I have
everything routing based on roles. Sorry i am unclear on some
terminology, if you can clarify the question, can answer.
Below is the image.php component code I have altered for my own
purposes including the ability to work with single or multi-image
upload (uploadify)
/////////////////////////////////////////////////// image.php
<?php
/*
File: /app/controllers/components/image.php
*/
class ImageComponent extends Object
{
/*
* Uploads an image and its thumbnail into $folderName/big and
$folderName/small respectivley.
* Also uploads a zoom cropped image into $folderName/home. You could
easily modify it to suit your needs!
* Directions:
* In view where you upload the image, make sure your form creation is
similar to the following
* <?= $form->create('FurnitureSet',array('type' => 'file')); ?>
* In view where you upload the image, make sure that you have a file
input similar to the following
* <?= $form->file('Image/name1'); ?>
* In the controller, add the component to your components array
* var $components = array("Image");
* In your controller action (the parameters are expained below)
* $image_path = $this->Image->upload_image_and_thumbnail($this-
>data,"name1", 573,380,80,80, "sets");
* this returns the file name of the result image. You can store
this file name in the database
*
* Note that your image will be stored in 3 locations:
* Image: /webroot/img/$folderName/big/$image_path
* Thumbnail: /webroot/img/$folderName/small/$image_path
* Homepage: /webroot/img/$folderName/home/$image_path
*
* You could easily add more locations or remove locations you don't
need
* Finally in the view where you want to see the images
* <?= $html->image('sets/big/'.$furnitureSet['FurnitureSet']
['image_path']);
* where "sets" is the folder name we saved our pictures in, and
$furnitureSet['FurnitureSet']['image_path'] is the file name we stored
in the database
* Parameters:
* $data: CakePHP data array from the form
* $datakey: key in the $data array. If you used <?= $form-
>file('Image/name1'); ?> in your view, then $datakey = name1
* $maxw: the maximum width that you want your picture to be resized
to
* $maxh: the maximum width that you want your picture to be resized
to
* $thumbscalew: the maximum width hat you want your thumbnail to be
resized to
* $thumbscaleh: the maximum height that you want your thumbnail to be
resized to
* $folderName: the name of the parent folder of the images. The
images will be stored to /webroot/img/$folderName/big/ and /webroot/
img/$folderName/small/
*/
function upload_image_and_thumbnail($data, $datakey, $maxw, $maxh,
$thumbscalew, $thumbscaleh, $folderName, $multi) {
if($multi == false){
$dName = $data['Image'][$datakey]['name'];
$dTempName = $data['Image'][$datakey]['tmp_name'];
}else if($multi == true){
$dName = $datakey;
$dTempName = $data;
}
if(strlen($dName)>4){
$error = 0;
$homedir = "../../../uploads";
if(!is_dir($homedir)){mkdir($homedir, 0777, true);}
$tempuploaddir = $homedir . "/temp"; // the /temp/ directory,
should delete the image after we upload
if(!is_dir($tempuploaddir)){mkdir($tempuploaddir, 0777, true);}
$homeuploaddir = $homedir."/images/".$folderName."/home"; // the /
home/ directory
if(!is_dir($homeuploaddir)){ mkdir($homeuploaddir , 0777,
true);} // octal; correct value of mode
$biguploaddir = $homedir . "/images/".$folderName."/big"; // the /
big/ directory
if(!is_dir($biguploaddir)){mkdir($biguploaddir , 0777, true);} //
octal; correct value of mode
$smalluploaddir = $homedir . "/images/".$folderName."/small"; //
the /small/ directory for thumbnails
if(!is_dir($smalluploaddir)){mkdir($smalluploaddir, 0777,
true);} // octal; correct value of mode
// Make sure the required directories exist, and create them if
necessary
if(!is_dir($tempuploaddir)) mkdir($tempuploaddir,true);
if(!is_dir($homeuploaddir)) mkdir($homeuploaddir,true);
if(!is_dir($biguploaddir)) mkdir($biguploaddir,true);
if(!is_dir($smalluploaddir)) mkdir($smalluploaddir,true);
$filetype = $this->getFileExtension($dName);
$filetype = strtolower($filetype);
if (($filetype != "jpeg") && ($filetype != "jpg") && ($filetype !
= "JPG") && ($filetype != "gif") && ($filetype != "png"))
{
// verify the extension
return;
}
else
{
// Get the image size
$imgsize = GetImageSize($dTempName);
}
// Generate a unique name for the image (from the timestamp)
$id_unic = str_replace(".", "", strtotime ("now"));
$filename = $id_unic;
settype($filename,"string");
$filename.= ".";
$filename.=$filetype;
$tempfile = $tempuploaddir . "/$filename";
//chmod($tempfile, 0777);
$homefile = $homeuploaddir . "/$filename";
//chmod($homefile, 0777);
$resizedfile = $biguploaddir . "/$filename";
//chmod($resizedfile, 0777);
$croppedfile = $smalluploaddir . "/$filename";
//chmod($croppedfile, 0777);
if (is_uploaded_file($dTempName)){
// Copy the image into the temporary directory
if (!copy($dTempName,"$tempfile")){
print "Error Uploading File!.";
exit();
}
else {
/*
* Generate the home page version of the image center cropped
*/
$this->resizeImage('resizeCrop', $tempuploaddir, $filename,
$homeuploaddir, $filename, 600, 400, 90);
/*
* Generate the big version of the image with max of $imgscale
in either directions
*/
$this->resizeImage('resize', $tempuploaddir, $filename,
$biguploaddir, $filename, $maxw, $maxh, 90);
/*
* Generate the small thumbnail version of the image with scale
of $thumbscalew and $thumbscaleh
*/
$this->resizeImage('resizeCrop', $tempuploaddir, $filename,
$smalluploaddir, $filename, $thumbscalew, $thumbscaleh, 85);
// Delete the temporary image
unlink($tempfile);
}
}
// Image uploaded, return the file name
return $filename;
}
}
/*
* Deletes the image and its associated thumbnail
* Example in controller action: $this->Image-
>delete_image("1210632285.jpg","sets");
*
* Parameters:
* $filename: The file name of the image
* $folderName: the name of the parent folder of the images. The
images will be stored to /webroot/img/$folderName/big/ and /webroot/
img/$folderName/small/
*/
function remove_image($filename, $folderName)
{
$homedir = "../../../uploads";
$homeuploaddir = $homedir."/images/".$folderName."/home"; // the /
home/ directory
$biguploaddir = $homedir . "/images/".$folderName."/big"; // the /
big/ directory
$smalluploaddir = $homedir . "/images/".$folderName."/small"; //
the /small/ directory for thumbnails
unlink($homeuploaddir . '/' . $filename);
unlink($biguploaddir . '/' . $filename);
unlink($smalluploaddir . '/' . $filename);
}
function getFileExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}
/*
* @param $cType - the conversion type: resize (default), resizeCrop
(square), crop (from center)
* @param $id - image filename
* @param $imgFolder - the folder where the image is
* @param $newName - include extension (if desired)
* @param $newWidth - the max width or crop width
* @param $newHeight - the max height or crop height
* @param $quality - the quality of the image
* @param $bgcolor - this was from a previous option that was
removed, but required for backward compatibility
*/
function resizeImage($cType = 'resize', $srcfolder, $srcname,
$dstfolder, $dstname = false, $newWidth=false, $newHeight=false,
$quality = 75)
{
$srcimg = $srcfolder.DS.$srcname;
list($oldWidth, $oldHeight, $type) = getimagesize($srcimg);
$ext = $this->image_type_to_extension($type);
//check to make sure that the file is writeable, if so, create
destination image (temp image)
if (is_writeable($dstfolder))
{
$dstimg = $dstfolder.DS.$dstname;
}
else
{
//if not let developer know
debug("You must allow proper permissions for image processing. And
the folder has to be writable.");
debug("Run \"chmod 777 on '$dstfolder' folder\"");
exit();
}
//check to make sure that something is requested, otherwise there is
nothing to resize.
//although, could create option for quality only
if ($newWidth OR $newHeight)
{
/*
* check to make sure temp file doesn't exist from a mistake or
system hang up.
* If so delete.
*/
if(file_exists($dstimg))
{
unlink($dstimg);
}
else
{
switch ($cType){
default:
case 'resize':
# Maintains the aspect ration of the image and makes sure that
it fits
# within the maxW(newWidth) and maxH(newHeight) (thus some side
will be smaller)
$widthScale = 2;
$heightScale = 2;
// Check to see that we are not over resizing, otherwise, set
the new scale
if($newWidth) {
if($newWidth > $oldWidth) $newWidth = $oldWidth;
$widthScale = $newWidth / $oldWidth;
}
if($newHeight) {
if($newHeight > $oldHeight) $newHeight = $oldHeight;
$heightScale = $newHeight / $oldHeight;
}
//debug("W: $widthScale H: $heightScale");
if($widthScale < $heightScale) {
$maxWidth = $newWidth;
$maxHeight = false;
} elseif ($widthScale > $heightScale ) {
$maxHeight = $newHeight;
$maxWidth = false;
} else {
$maxHeight = $newHeight;
$maxWidth = $newWidth;
}
if($maxWidth > $maxHeight){
$applyWidth = $maxWidth;
$applyHeight = ($oldHeight*$applyWidth)/$oldWidth;
} elseif ($maxHeight > $maxWidth) {
$applyHeight = $maxHeight;
$applyWidth = ($applyHeight*$oldWidth)/$oldHeight;
} else {
$applyWidth = $maxWidth;
$applyHeight = $maxHeight;
}
$startX = 0;
$startY = 0;
break;
case 'resizeCrop':
// Check to see that we are not over resizing, otherwise, set
the new scale
// -- resize to max, then crop to center
if($newWidth > $oldWidth) $newWidth = $oldWidth;
$ratioX = $newWidth / $oldWidth;
if($newHeight > $oldHeight) $newHeight = $oldHeight;
$ratioY = $newHeight / $oldHeight;
if ($ratioX < $ratioY) {
$startX = round(($oldWidth - ($newWidth / $ratioY))/2);
$startY = 0;
$oldWidth = round($newWidth / $ratioY);
$oldHeight = $oldHeight;
} else {
$startX = 0;
$startY = round(($oldHeight - ($newHeight / $ratioX))/2);
$oldWidth = $oldWidth;
$oldHeight = round($newHeight / $ratioX);
}
$applyWidth = $newWidth;
$applyHeight = $newHeight;
break;
case 'crop':
// -- a straight centered crop
$startY = ($oldHeight - $newHeight)/2;
$startX = ($oldWidth - $newWidth)/2;
$oldHeight = $newHeight;
$applyHeight = $newHeight;
$oldWidth = $newWidth;
$applyWidth = $newWidth;
break;
}
switch($ext)
{
case 'gif' :
$oldImage = imagecreatefromgif($srcimg);
break;
case 'png' :
$oldImage = imagecreatefrompng($srcimg);
break;
case 'jpg' :
case 'jpeg' :
case 'JPG' :
$oldImage = imagecreatefromjpeg($srcimg);
break;
default :
//image type is not a possible option
return false;
break;
}
//create new image
$newImage = imagecreatetruecolor($applyWidth, $applyHeight);
//put old image on top of new image
imagecopyresampled($newImage, $oldImage, 0,0 , $startX, $startY,
$applyWidth, $applyHeight, $oldWidth, $oldHeight);
switch($ext)
{
case 'gif' :
imagegif($newImage, $dstimg, $quality);
break;
case 'png' :
imagepng($newImage, $dstimg, $quality/10);
break;
case 'jpg' :
case 'jpeg' :
case 'JPEG' :
imagejpeg($newImage, $dstimg, $quality);
break;
default :
return false;
break;
}
imagedestroy($newImage);
imagedestroy($oldImage);
return true;
}
} else {
return false;
}
}
function image_type_to_extension($imagetype)
{
if(empty($imagetype)) return false;
switch($imagetype)
{
case IMAGETYPE_GIF : return 'gif';
case IMAGETYPE_JPEG : return 'jpg';
case IMAGETYPE_PNG : return 'png';
case IMAGETYPE_SWF : return 'swf';
case IMAGETYPE_PSD : return 'psd';
case IMAGETYPE_BMP : return 'bmp';
case IMAGETYPE_TIFF_II : return 'tiff';
case IMAGETYPE_TIFF_MM : return 'tiff';
case IMAGETYPE_JPC : return 'jpc';
case IMAGETYPE_JP2 : return 'jp2';
case IMAGETYPE_JPX : return 'jpf';
case IMAGETYPE_JB2 : return 'jb2';
case IMAGETYPE_SWC : return 'swc';
case IMAGETYPE_IFF : return 'aiff';
case IMAGETYPE_WBMP : return 'wbmp';
case IMAGETYPE_XBM : return 'xbm';
default : return false;
}
}
}
?>
//////////////////End image.php
//////////////////////////////////Relevant photoController Code
<?php
class PhotosController extends AppController {
var $name = 'Photos';
var $components = array("Image");
var $helpers = array('Html', 'Javascript', 'Form');
.....................................
function add() {
$tags = $this->Photo->Tag->find('list', array('fields' =>
array('Tag.tag')));
$this->set(compact('tags'));
if (!empty($this->data)) {
$this->Photo->create();
if ($this->Photo->save($this->data))
{
// resize the image to1200x800 and create a square thumbnail 80x80
$image_path = $this->Image->upload_image_and_thumbnail($this-
>data,"name1", 1200,800,80,80, "photography", false);
if(isset($image_path)) {
$this->Photo->saveField('image',$image_path);
$this->Session->setFlash(sprintf(__('The %s has been saved',
true), 'photo'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(sprintf(__('The %s could not be saved.
Please, try again.', true), 'photo'));
}
}
}
}
function upload() {
if (isset($this->params['form']['Filedata'])) {
$image_path = $this->Image->upload_image_and_thumbnail($this-
>params['form']['Filedata']['tmp_name'],$this->params['form']
['Filedata']['name'],1200,800,80,80, "photography", true);
if(isset($image_path)) {
$this->Photo->saveField('image',$image_path);
//Put success message and redirect here
}else{
//Put error message here
}
}
}
// Handle multiple incoming uploads.
function addmulti() {
// all necessarry code is handled in the view
}
/////////////////////////////////////////////////////////////// add
view
echo $form->create('Photo',array('type' => 'file'));
?>
<fieldset>
<legend><?php printf(__('Add %s', true), __('Photo', true)); ?></
legend>
<?php
echo $this->Form->input('title');
echo $form->file('Image.name1', array('escape'=>false));
echo $this->Form->input('client');
echo $this->Form->input('description');
echo $this->Form->input('Tag');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>
//////////////////////////////////////////////////////////////////
Multi-Add View
<script type="text/javascript">
$(document).ready(function() {
$("#fileInput2").uploadify({
'uploader' : '/admin/swf/uploadify.swf',
'script' : '<?php echo $html->url('/photos/upload/'.$session-
>id()); ?>',
'cancelImg' : '/admin/img/cancel.png',
'fileExt' : '*.JPG;*.jpg;*.jpeg;*.png;*.gif',
'folder' : '../../../uploads/temp/',
'multi' : true,
'auto' : true,
'simUploadLimit' : 2,
'sizeLimit' : 7000000
});
});
</script>
<p><strong>Multiple File Upload</strong></p>
<?php echo $form->file('Image.name1', array('escape'=>false,
'id'=>'fileInput2')); ?>
<a href="javascript:$('#fileInput2').uploadifyClearQueue();">Clear
Queue</a>
<!-- Dependencies for uploadify uploader -->
<?php
if(isset($javascript)){
echo $this->Html->css('uploadify') . "\n";
echo $this->Javascript->link('swfobject') . "\n";
echo $this->Javascript->link('jquery-1.3.2.min') . "\n";
echo $this->Javascript->link('jquery.uploadify.v2.1.0') . "\n";
}
?>
When I have the time i'll put this together more cleanly for others. I
had such a pain figuring it out I hope it helps others.
On May 3, 2:20 am, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> Hi Aaron,
>
> Sure I would love to see how you have used uploadify in a component.
>
> Have you managed to get it working with admin routing? The code you posted
> so far does not use the admin prefix
>
> - S
>
> On 3 May 2010 08:47, Andrei Mita <andrei.m...@gmail.com> wrote:
>
> > Your timing could not be better. Thanks
>
> > On Mon, May 3, 2010 at 9:05 AM, abocanegra <aaronbocane...@gmail.com>wrote:
>
> >> I have it working -
>
> >> photoController -
>
> >> function upload(){
>
> >> if (isset($this->params['form']['Filedata']))
> >> {
> >> $tempFile = $this->params['form']['Filedata']['tmp_name'];
> >> $targetPath = '../../../uploads/temp/';
> >> $targetFile = str_replace('//','/',$targetPath) . $this-
> >> >params['form']['Filedata']['name'];
>
> >> move_uploaded_file($tempFile,$targetFile);
> >> echo "1";
>
> >> $image_path = $this->params['form']['Filedata']['name'];
>
> >> if(isset($image_path))
> >> {
>
> >> $this->Photo->saveField('image',$image_path);
> >> //Put success message and redirect here
> >> }else{
> >> //Put error message here
> >> }
> >> }
> >> }
> >> // Handle multiple incoming uploads.
> >> function addmulti() {
> >> }
>
> >> //Addmulti view (no upload view)
> >> <script type="text/javascript">
> >> $(document).ready(function() {
> >> $("#fileInput2").uploadify({
> >> 'uploader' : '/admin/swf/uploadify.swf',
> >> 'script' : '<?php echo
> >> $html->url('/photos/upload/'.$session-
> >> >id()); ?>',
> >> 'cancelImg' : '/admin/img/cancel.png',
> >> 'fileExt' :
> >> '*.JPG;*.jpg;*.jpeg;*.png;*.gif',
> >> 'folder' : '../../../uploads/temp/',
> >> 'multi' : true,
> >> 'auto' : true,
> >> 'simUploadLimit' : 1,
> >> 'sizeLimit' : 7000000
> >> });
> >> });
> >> </script>
> >> <p><strong>Multiple File Upload</strong></p>
> >> <?php echo $form->file('Image.name1', array('escape'=>false,
> >> 'id'=>'fileInput2')); ?>
> >> <a href="javascript:$('#fileInput2').uploadifyClearQueue();">Clear
> >> Queue</a>
>
> >> Enjoy - I also have it working with the image.php component now, i
> >> have had to update the component, but it was fairly straightforward.
> >> Let me know if you want info about that implementation.
>
> >> On Apr 9, 1:10 am, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> >> > I saw Fonzie was making progress with uploadify (having a discussion
> >> with
> >> > himself on this list as I recall - but productive 1)
>
> >> > he documented his progress on uploadify forum - I also tried his
> >> findings to
> >> > partially good results - better than swfupload anyway
>
> >> > here is the linkhttp://
> >>www.uploadify.com/forum/viewtopic.php?f=7&t=5017&p=9334&hilit=...
>
> >> > I managed to get files uploading (multiple files) but not able to
> >> > insert/update to db - and it logged me out after too
>
> >> > I was using cake 1.3 & latest uploadify too
>
> >> > - S
>
> >> > On 9 April 2010 08:47, luke BAKING barker <lukebar...@gmail.com> wrote:
>
> >> > > any luck with this? I would like to try uploadify but it seems there
> >> > > are only broken reports with cake in the google group? Anybody used it
> >> > > successfully out there?
>
> >> > > regards
>
> >> > > Luke
>
> >> > > On Mar 21, 10:41 pm, abocanegra <aaronbocane...@gmail.com> wrote:
> >> > > > Correction - However, problems still not fixed
>
> >> > > > ################ upload function had a typo, fixed it but still not
> >> > > > uploading file
> >> > > > function upload()
> >> > > > {
> >> > > > if (isset($this->params['form']['Filedata']))
> >> > > > {
> >> > > > //Derived from theuploadify.php file - does not work
> >> > > > $tempFile = $this->params['form']['Filedata']['name'];
> >> > > > $targetPath = '
> >>http://www.whatartist.com/uploads/temp';
> >> > > > $targetFile = str_replace('//','/',$targetPath) .
> >> > > $this->params['form']['Filedata']['name'];
>
> >> > > > move_uploaded_file($tempFile,$targetFile);
>
> >> > > > $image_path =
> >> $this->params['form']['Filedata']['name'];
>
> >> > > > if(isset($image_path))
> >> > > > {
>
> >> > > $this->Photo->saveField('image',$image_path);
> >> > > > //Put success message and
> >> > > redirect here
> >> > > > }else{
> >> > > > //Put error message here
> >> > > > }
> >> > > > }
> >> > > > }
>
> >> > > > Also, I beleive the multiple posting - beyond 2 entries - was a
> >> > > > session issue. I deleted all sessions in the phptmpdir and it fixed
> >> > > > that issue.
> >> > > > I still cannot upload the file though.
>
> >> > > > On Mar 20, 9:40 pm, abocanegra <aaronbocane...@gmail.com> wrote:
>
> >> > > > > Alright, ahead of time thanks for any help on this. I have been
> >> > > > > researching for far longer than I care to admit. I am attempting
> >> to
> >> > > > > getuploadify2.1 to work with cakePHP 1.3. I have read up a great
> >> > > > > deal on other formats as well, such as swfupload.
>
> >> > > > > Controller name = photos_controller.php
> >> > > > > relevant functions = upload & addmult
> >> > > > > Model Name = photo.php
> >> > > > > views= addmult.ctp (upload.ctp is just the function being called
> >> from
> >> > > > > addmult)
>
> >> > > > > Sucesses - I have been able to get the browse and upload working
> >> (on
> >> > > > > the surface). It appears to handle a multi-upload, or at least
> >> goes
> >> > > > > through the paces. Also I am able to trigger the upload function
> >> from
> >> > > > > the controller and add either the name using $this->params['form']
> >> > > > > ['Filedata']['name'].
>
> >> > > > > Problems -
> >> > > > > I cannot get the file uploaded to my uploads/temp directory (it
> >> is
> >> > > > > 777 and works well with my single image upload script). I have
> >> tried
> >> > > > > every variation including absolute paths to get to it
> >> > > > > .
> >> > > > > There does not seem to be any error messages, I have tried adding
> >> a
> >> > > > > few from the various forums, none have done anything.
>
> >> > > > > When I trigger the multiple uploads it goes through the paces, but
> >> > > > > only adds one entry into the database.
> >> > > > > Also It appears the database tends to only accept 2 entries,
> >> though I
> >> > > > > haven't thoroughly tested that problem.
>
> >> > > > > Goal -
> >> > > > > I am hoping to implement this function so that I can utilize it
> >> with
> >> > > > > image.php which i have altered to create the files in the manner I
> >> > > > > need. To do this I will need to be able to send the file to
> >> image.php
> >> > > > > for scale changes, multifolder organization and name changes.
> >> After
> >> > > > > which it will redirect to a page to add the additional info
> >> (title,
> >> > > > > client, etc) needed.
>
> >> > > > > Any advice on any of the issues would be appreciated.
>
> >> > > > > Code Snippets:
>
> >> > > > > Controller:
> >> > > > > #################################################
> >> > > > > class PhotosController extends AppController {
>
> >> > > > > var $name = 'Photos';
> >> > > > > var $components = array("Image");
> >> > > > > var $helpers = array('Html', 'Javascript', 'Form');
>
> >> > > > > function beforeFilter() {
> >> > > > > if ($this->action == 'upload') {
> >> > > > > $this->Session->id($this->params['pass'][0]);
> >> > > > > $this->Session->start();
> >> > > > > }
> >> > > > > parent::beforeFilter();
> >> > > > > }
>
> >> > > > > function upload()
> >> > > > > {
> >> > > > > if (isset($this->params['form']['Filedata']))
> >> > > > > {
> >> > > > > //Derived from theuploadify.php file - does not work
> >> > > > > //$tempFile =
> >> $this->params['form']['Filedata']['tmp_name'];
> >> > > > > // $targetPath = '
> >>http://www.whatartist.coms/uploads/temp
> >> > > ';
> >> > > > > // $targetFile = str_replace('//','/',$targetPath) .
> >> > > $this->params['form']['Filedata']['name'];
>
> >> > > > > //move_uploaded_file($tempFile,$targetFile);
>
> >> > > > > $image_path =
> >> > > $this->params['form']['Filedata']['name'];
>
> >> > > > > if(isset($image_path))
> >> > > > > {
>
> >> > > $this->Photo->saveField('image',$image_path);
> >> > > > > //Put success message and
> >> > > redirect here
> >> > > > > }else{
> >> > > > > //Put error message here
> >> > > > > }
> >> > > > > }
> >> > > > > }
>
> >> > > > > // Handle multiple incoming uploads.
> >> > > > > function addmulti() {
> >> > > > > //Left empty because it was providing no functionality
> >> > > > > // I did try posting to this instead of upload function
> >> but
> >> > > > > didn't work so cleared it
> >> > > > > }
>
> >> > > > > function upload()
> >> > > > > {
> >> > > > > if (isset($this->params['form']['Filedata']))
> >> > > > > {
>
> >> > > > > //Derived from
>
> ...
>
> read more »
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment