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.
 
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.
 
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
 
I'm sorry but could you tell me what to do to make this upload possible?
 
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.
 
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.
Hello
would it possible to give me a example of file upload with api .
assume in my local machine I have a jpg file and want to upload to my site directly with api.
thanks in advance
 
Back
Top