Start a new topic

Create multiple directories under "home" users via API

 Hey there,

I want to automate the usrs creation and setup multiple directories in the user's home dir.

I'm using the command:

curl -g -d command=setUserItem -d data_action=replace -d xmlItem=user -d serverGroup=MainUsers -d username=testuser--data-urlencode user@user.xml --data-urlencode vfs_items@vfs_items.xml --data-urlencode permissions@permissions.xml --netrc-file passwd.txt http://crushftp_url:8080

It works, but it creates only one directory instead of two and it assign no privileges to the new created directories.

I have permissions.xml file:

?xml version="1.0" encoding="UTF-8"?>
<VFS type="properties">
<item name="/data/">(read)(view)(write)(delete)(resume)(download)(upload)(create)</item>
<item name="/data/clean/">(read)(view)(write)(delete)(resume)(download)(upload)(create)</item>
<item name="/data/dirty/">(read)(view)(write)(delete)(resume)(download)(upload)(create)</item>

Also, the vfs_items.xml:

<?xml version="1.0" encoding="UTF-8"?>
<vfs_items type="vector">
<vfs_items_subitem type="properties">
<vfs_item type="vector">
<vfs_item_subitem type="properties">

What i need is: to create the data directory ( it does)

In data dir to ceate the dirty and clean directory ( it creates only dirty directory)

I need (read)(view)(write)(delete)(resume)(download)(upload)(create) right on those directory.

Please advice. Thank you.

1 Comment

Your off on your xml data, both of them for the VFS. Do the same actions in the User Manager. Use chrome. Watch the network tab. Compare what it sends versus what you sent as your structure is not the same, and you didn't match case on the permissions. --Ben
Login to post a comment