I have been looking into this for a while and can\'t figure it out. Basically I have an add page for my model which you can add a map from a URL or from a file upload. I have go
Firstly your form needs to be set up to allow file uploads.
create(Model, array('type' => 'file')); ?>
This will allow any file inputs to actually upload the file to your server with $form->file(field)
or $form->input(field, array('type' => 'file'))
.
Once the file has been uploaded you should handle everything else from within the Model:
function beforeSave($created) {
extract($this->data[Model][field]);
if ($size && !$error) {
move_uploaded_file($tmp_name, destination);
$this->data[Model][field] = destination;
}
return true;
}
These are only the basics, so be sure to have a play around to find the solution that best fits your needs.