Results 1 to 6 of 6

Thread: Create file via API not working

  1. #1
    Join Date
    Dec 2008
    Posts
    279

    Create file via API not working

    Hi,
    am using simple get parameters and it's not save the file:
    Code:
    https://server01.mydomain.tld:2222/CMD_FILE_MANAGER?json=yes&action=file&path=/&name=yourfile.txt&text=dsadasadaasassaa
    but not new file named yourfile.txt that contain dsadasadaasassaa
    as I see at: https://www.directadmin.com/features.php?id=652

    Regards,

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,274
    Hello,

    Tried to send request to CMD_API_FILE_MANAGER? What error do you get?

  3. #3
    Join Date
    Dec 2008
    Posts
    279
    Hi,
    1. I try with both CMD_API_FILE_MANAGER and CMD_FILE_MANAGER, it's should work with both
    2. json=yes show me "TEXT": ""
    mean, text not inserted
    DirectAdmin updated, 1.5.4

    Regards,

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,274
    OK, I see.

    I did not manage to get it working on my end as well. I've ended up with:

    /CMD_API_FILE_MANAGER?json=yes&action=edit&path=%2F&name=test.txt&text=dsadasadaasassaa

    query, which results in a segmentation fault. I've reported the segmentation fault to Directadmin support. Let's see what they say.

  5. #5
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,274
    The segmentation fault is now fixed by Directadmin developers in 1.54.0, and still I did not manage to get API working on my end.


  6. #6
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    12,274
    Succeeded with


    POST request to CMD_API_FILE_MANAGER with the following values:

    action=edit
    path=/path/to/directory
    filename=new.txt
    text=contents of the filejson=yes


    none value should be sent in URL

    Check action=edit section from https://www.directadmin.com/features.php?id=652

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •