| Новости | FAQ | Авторы | Документация | В действии | Библиотека |
| Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
MultiSync 29.07.2004 22:41 / 29.07.2004 22:42
<fieldset><legend>Как раз эта форма</legend>
<table>
<form method="post" enctype="multipart/form-data" name="img">
<tbody>
<tr>
<td>
<input type="file" name="photo">
</td>
<tr>
<td>
<input type="submit" value="Сохранить">
</td>
</tbody>
</form>
</table>
</fieldset>
^if(def $form:photo){
^try{
$photo[^image::measure[$form:photo]]
}{
^if($exception.type eq image.format){
$exception.handled(1)
Неверный формат,
<pre>$exception.comment</pre>
}
}
$width($photo.width)
$height($photo.height)
^if($width <= 200 && $height <= 200){
^if(-d "/1"){
$table[^file:list[/1/]]
^if(def $table){
^table.menu{
^file:delete[/1/${table.name}]
}
}
}
############ Сохранение изображения
$ras[^file:justext[$form:photo.name]]
^form:photo.save[binary;/1/1.$ras]
$response:refresh[
$.value[0]
$.url[/authors/admin/?name=$auth_table.au_eng&function=pas]
]
}
}