С помощью апи мне нужно создать элемент информационной системы и привязать к нему файл.
Создаю Инфо Систему
$InformationSystemItem = $InformationSystem->InsertInformationItem(
array(
'information_systems_id' => $InformationSystemId,
'information_items_name' => $title,
'information_items_description' => $text,
'information_items_date' => date('Y-m-d H:i:s', time()),
'information_items_image' => 'avatar.jpg'
)
);
Получаю путь к файлам Элемента инфосистемы
$InformationSystemItemFilesDir = $InformationSystem->GetInformationItemDir($InformationSystemItem);
Создаю папки
$kernel->PathMkdir($InformationSystemItemFilesDir, 0777);
Загружаю файл
$uploadedImage = $kernel->AdminLoadFiles(
array(
'path_source_big_image' => $file['tmp_name'],
'path_source_small_image' => '',
'original_file_name_big_image' => $file['name'],
'path_target_big_image' => $rootPath . $InformationSystemItemFilesDir . 'avatar.jpg',
'path_target_small_image' => $rootPath . $InformationSystemItemFilesDir . 'avatar_small.jpg',
'original_file_name_small_image' => '',
'max_width_big_image' => $InformationSystemData['information_systems_image_big_max_width'],
'max_height_big_image' => $InformationSystemData['information_systems_image_big_max_height'],
'max_width_small_image' => $InformationSystemData['information_systems_image_small_max_width'],
'max_height_small_image' => $InformationSystemData['information_systems_image_small_max_height']
)
);
Файл загружается, но я получаю вот такое:
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'Z:/home/localhost/www/upload/information_system_15/0/9/8/item_98/avatar.jpg' for writing: Permission denied in Z:\home\localhost\www\modules\Kernel\Image.class.php on line 472
upload/information_system_15/0/9/8/item_98/
Все делается на php 5.2 под windows 7 x64