Uploading files error.

z1089

New member
Joined
Jul 7, 2014
Messages
15
Hello. I'm traying to upload files but i'm getting error (error occurred) without any details. Here is my code:
PHP:
$sock->set_method('POST');
$path = "/domains/userdomain.com/public_html";
$file = "/home/kreatorv/domains/domain.com/public_html/index2.htm";
 $sock->query('/CMD_API_FILE_MANAGER',
array(
'enctype' => "multipart/form-data",
'action' => 'upload',
'path' => $path,
'file1' => $file
));
$result = $sock->fetch_result();
var_dump($result);
I'm logging as user who owns domain in $path.
Thanks for any help.
 

z1089

New member
Joined
Jul 7, 2014
Messages
15
It's not the same user. Api script is in the same catalog as file i'm trying to upload. I have only reseller account so i can't change debug mode.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,105
Location
GMT +7.00
It's not the same user.
Then it seems to be a permission issue. Users can not see/copy/read files of other users located in their home dirs by default here.

For debugging may use standart PHP functions to read/write files. See http://php.net/manual/ for more details
 

z1089

New member
Joined
Jul 7, 2014
Messages
15
I'm sorry but could you tell me what to do to make this upload possible?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,105
Location
GMT +7.00
Either allow the user under which you run api to access the file or place it to where it can be reached by the user.
 
Top