我有重命名文件的问题。我需要新文件名是西里尔字母,但是,当在 img 文件夹中重命名 img 时,新名称是“РҐСЂРёСЃС,Рѕ Р'РѕС,ев.jpg”。那是我的代码:
$newName = $formdata['name'];
try {
$ext = end(explode('.', $form->img3->getFileName()));
path = (APPLICATION_PATH . '/../public/imgs/' . $newName . '.') . $ext;
$form->img3->addFilter('Rename', array('target' => $path,
'overwrite' => true));
$form->img3->receive();
$form->reset();
}
catch (Exception $e)
{
$editMessage[][] = 'Invalid image.';
}