AdminLoadFiles проблемы с правами доступа.

#
AdminLoadFiles проблемы с правами доступа.
С помощью апи мне нужно создать элемент информационной системы и привязать к нему файл.

Создаю Инфо Систему
$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
Модератор
#
Re: AdminLoadFiles проблемы с правами доступа.
Вы это делаете в каком-то отдельном файле?
#
Re: AdminLoadFiles проблемы с правами доступа.
Да, живет по такому адресу /templates/flowers/ajax-items/insert-information-item.php

В нем загружаю нужные файлы
$rootPath = $_SERVER['DOCUMENT_ROOT'] . '/';

require_once($rootPath . 'main_classes.php');

require_once($rootPath . 'modules/InformationSystems/InformationSystems.class.php');

$kernel = & singleton('kernel');;

$InformationSystem     = new InformationSystem();
Модератор
#
Re: AdminLoadFiles проблемы с правами доступа.
В самом начале делаете так:

$kernel = & singleton('kernel');

// Загрузка модулей
$kernel->LoadModules();

/* Идентификатор сайта */
define('CURRENT_SITE', 1);

// Инициализация констант.
$kernel->InitConstants();
#
Re: AdminLoadFiles проблемы с правами доступа.
Спасибо.
Модератор
#
Re: AdminLoadFiles проблемы с правами доступа.
Пожалуйста
Авторизация