Новости | FAQ | Авторы | Документация | В действии | Библиотека |
Инструменты | Полезные ссылки | Хостинги | Скачать | Примеры | Форум |
Beau 30.07.2006 03:55 / 30.07.2006 03:57
Пытаюсь сохранить несколько изображений. Использую класс images.p.<form method="POST" enctype="multipart/form-data" action="$request:uri"> <div><input type="file" name="pict" style="width:100%" size="50" /></div> <div><input type="file" name="pict" style="width:100%" size="50" /></div> <input type="submit" name="save" value="Сохранить"> </form> ^if(def $form:save){ $imgs[$form:tables.pict] $source_path[/i/big/] $destination_path[/i/small/] $user_format[jpg] ^if($imgs){ ^imgs.menu{ $name[^math:uid64[]] $extension[^file:justext[$imgs.field]] $image_name[${name}.$extension] ^if($extension ne $user_format){$format[$user_format]} ^if(!^images:save[$form:pict;$source_path;$image_name;$format]){ ^if(^extension.lower[] ne ^user_format.lower[]){ $image_name[${image_name}.$format] } $status[^images:resize[ $.source_path[$source_path] $.destination_path[$destination_path] $.image_name[$image_name] $.x_size(100) $.quality[80] ]] ^if(!$status){ ^rem{ *** Всё ок *** } }{ ^rem{ *** Возникла ошибка *** } $status } } } } }