Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Copy files from one domain to another on same server.

Discussion in 'cPanel Developers' started by pawan0446, Jun 6, 2017.

  1. pawan0446

    pawan0446 Registered

    Joined:
    Jun 6, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    india
    cPanel Access Level:
    Reseller Owner
    Hello,

    I am looking for API to copy file from one account(domain) to another account(domain) through resellar account.

    i have also created dynamic account using WHM API-1 and copy file through following API method:

    WHM API 1 Functions - createacct - Software Development Kit - cPanel Documentation

    My request is like:

    Code:
    [URL]https://hostname.example.com:2087/json-api/createacct?api.version=1&username=userdemo&domain=userdemo.com&contactemail=userdemo@userdemo.com[/URL]
    Some codes: using XMLAPI PHP

    Code:
    $testArgs = array(
               'sourcefiles'      => '/home/user1/public_html/domntest/moveto.zip',
               'destfiles'        => '/home/user2/public_html/domntest/moveto.zip',
               'op' => 'copy'
              );
    $r = $this->xmlapi->api2_query('user', "Fileman", "fileop", $testArgs );
    
    Referred threads:

    1. Copy Files From To cPanel Accounts Using API?
    2. How to Copy file between account with xml-api, api2?

    Please check above and let me know where am I doing wrong or is there any different approach to get done my task.


    Any kind of help is much appreciated.

    Thanks
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice