Create ftp account

Youngpower

New member
Joined
Apr 19, 2007
Messages
2
I'have been searching trough this forum and google, but didn't find an answer.

I want to create ftp accounts with the API function of DA...

Can someone give me an example how to make this in PHP?

Thank You
 
PHP:
<?
//als eerst includen wij de socket zodat we die kunnen gebruiken 
include("httpsocket.php"); 

//nou de socket is geinclude kunnen we hem starten 
$sock = new HTTPSocket; 

//nu gaan we inloggen in Direct Admin (verander wel de gegevens) 
$sock->connect('youngpower.be',2222); 
$sock->set_login('admin','************); 

$sock->set_method('POST'); 

//hier komt dalijk de code om iets te gaan doen met de gegevens 

$sock->query('/CMD_API_FTP',  
    array(
'action' => 'create',
'domain' => 'youngpower.be',
'user' => 'test',
'type' => 'custom',
'path' => '/home/admin/domains/youngpower.be/public_html/fotos',
'passwd' => 'test',
'passwd2' => 'test'

));

$result = $sock->fetch_body();  
echo $result;
?>

This is what I have found, if i use type 'user', it works. But when I user 'custom' I get the following error:

error=1&text=Error executing your request&details=That is not a valid path. Either it is not in your home directory, it doesn't exist, it contains symbolic links, or it contains invalid characters<br>

Any idea somebody?

THx
 
I get the same error when trying to just create a custom path for a new ftp account:



That is not a valid path. Either it is not in your home directory, it contains symbolic links, or it contains invalid characters


any solution?
 
I'm giving this a little bump - I'm getting exactly the same error.

I'm not a huge fan of thread necrology, but any ideas on this?
 
Hello,

'path' is actually supposed to be called:

custom_val

If you check the html form in DA for any command you want to use, the API version is usually exactly the same.

John
 
Good lord, why didn't I think of looking at the field value.
Thanks ever so much! This has made my day!
 
I get the same error when trying to just create a custom path for a new ftp account:



That is not a valid path. Either it is not in your home directory, it contains symbolic links, or it contains invalid characters


any solution?
 
Why isn't this working with the newest versions of directadmin?

I need to create extra ftp users but cant get it to work

Fout 324 (net::ERR_EMPTY_RESPONSE): Onbekende fout
 
Last edited:
Back
Top