hi all.
the error is that the uploadfield is saving the file in the rigth folder (temas), i check and the file is saved ok. but when in the template I link the file with $link or $URL the path is wrong, is like was saved to the folder assets/ and not to the folder assets/temas.
here the code.
class Musica extends Page {
static $db = array(
);
static $has_many = array(
'Canciones' => 'File'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
$canciones = new UploadField('Canciones');
$canciones->getValidator()->allowedExtensions = array('mp3', 'wav');
$fields->addFieldToTab("Root.Canciones", $canciones);
$canciones->setFolderName('temas');
return $fields;
}
}
class Musica_Controller extends Page_Controller {
}
// and in the template
<% control $Canciones %>
<div >
$Link- $URL//both throw the path to the file in the folder assetst/
</div>
<% end_control %>
is like the record saved at the file table in the db is not taking care the folder that was saved the file.
can any body help me?
the version of SS is 3.0.5.
Bye!