saludo a todos
estaba buscando de como puede devolver el nuevo nombre al subir la imagen
este es me codigo:
Código PHP:
Ver original$fileInput = new InputFilter\FileInput('image-file');
$fileInput->setRequired(true);
// You only need to define validators and filters
// as if only one file was being uploaded. All files
// will be run through the same validators and filters
// automatically.
$fileInput->getValidatorChain()
->attachByName('filesize', array('max' => 20480000)) ->attachByName('filemimetype', array('mimeType' => 'image/png,image/x-png,image/jpeg,image/JPG')) ->attachByName('fileimagesize', array('maxWidth' => 2000, 'maxHeight' => 1500));
// All files will be renamed, i.e.:
// ./data/tmpuploads/avatar_4b3403665fea6.png,
// ./data/tmpuploads/avatar_5c45147660fb7.png
$filter = $fileInput->getFilterChain()->attachByName(
'filerenameupload',
'target' => './data/tmpuploads/img.png',
'randomize' => true,
)
);
$inputFilter->add($fileInput);
$this->setInputFilter($inputFilter);