Version 1.27.2

Released: 2006-05-27

CMD_API_FILE_MANAGER new

List all files and their info for a given path:

method GET or POST
path=/directory
if nothing is passed, then / is assumed.
You can use path=/ as well.
Return format is quite huge
<path/file>=path=name&type=file|dir&size=123inbytes&showsize=0.0k&perm=755&date=unixtime&uid=actualname&gid=actualgroup(not number)&truepath=/full/path/to/file&linkpath=/points/to/elsewhere
&<path2/file2>=repeat format again.
&<path3/file3>=repeat format again.

linkpath will be blank for most cases, unless the file is a symbolic link, then it will contain info. If a symbolic link points to a directory, then islink=1 will also be present.

It is not recommended to download files using CMD_API_FILE_MANAGER.

It's better to use CMD_FILE_MANAGER as the output is always going to be just the file's data anyway. eg: CMD_FILE_MANAGER?path=/path/file.jpg

Upload a file:

method must be POST
enctype="multipart/form-data" .. must encode it properly.
action=upload
path=/path/you're/uploadingto
file1=filename
... this isn't straight forward, you'll need to lookup up how a browser sends/encodes the files to duplicate this.

Compress a file:

action=compress
path=/path/you're in
name=file to compress (DA will add .tar.gz, eg just use "file")
It will compress the files listed in the /.clipboard.txt file.

Extract a file

path=/path/to/file.tar.gz
action=extract
directory=/path/to/extraction
page=2

Protect a directory:

CMD_API: catch-all, pop passwords, frontpage, protected dirs, ssl certs

Rename file/directory:

method POST only.
action=rename
path=/filesdirectory
old=file.html
filename=newfile.html
overwrite=yes|no  (not passing this option is the same as 'no')

Copy file:

method POST only.
action=copy
path=/filesdirectory
old=file.html
filename=newfile.html
overwrite=yes|no  (not passing this option is the same as 'no')

Create directory:

method: GET or POST
action=folder
path=/current/path
name=newfoldername

Set file(s) permission.

method: GET or POST
action=multiple
permission=<anything>   or   button=permission
chmod=755
path=/current/path
select0=/current/path/file1
(select1=/current/path/file2
select2=etc..)

Add files to clipboard.

method: GET or POST
action=multiple
add=<anything>
path=/current/path
select0=/current/path/file1
(select1=/current/path/file2
select2=etc..)

Delete files/directories

method: GET or POST
action=multiple
button=delete
path=/current/path
select0=/current/path/file1
(select1=/current/path/file2
select2=etc..)

Copy clipboard files to this path.

method: GET or POST
action=multiple
copy=<anything>
path=/current/path

Move clipboard files to this path.

method: GET or POST
action=multiple
move=<anything>
path=/current/path

Empty Clipboard:

method: GET or POST
action=multiple
empty=<anything>

View a file to edit:

method: GET with *no* POST values at all.
action=edit
path=/current/path/youfile.txt

was mainly added/documented here for the:

json=yes

output, as it's not terribly useful for the CMD_API version, since you can just grab the file directly.

It's added for:

CMD_FILE_MANAGER?json=yes&action=edit&...

Saved edited file:

method: POST with *no* GET values at all.
action=edit
path=/current/path
text=contents of the file
filename=yourfile.txt

View a file that does not yet exist, to create:

method: GET or POST
action=file
path=/current/path
text=contents of the file
name=yourfile.txt
template=yes  (optional: omit for no html)

was mainly added/documented here for the:

json=yes

output, as it's not terribly useful for the CMD_API version, since you can just grab the file directly.

It's added for:

CMD_FILE_MANAGER?json=yes&action=file

=================

Filesize for 1 file

method: POST or GET
action=filesize
path=/path/to/file.txt

returns:

size=123456  (in bytes) or error=1 with error message

move User Site Backup to task.queue new

Moving the location the site backup is run into the background.

This will prevent users having to sit and wait the backup to finish in their browser.

Note: currently you can browse elsewhere (close the window) and the backup will not stop, but that's not very clear. No response is given to the browser until the backup is done, so it's not clear if anything is happening at all, hence the change.

task.queue entry:

action=backup&type=sitebackup&value=bob&select0=ftp&select1=email&, etc (backup options)

random button for new pop accounts (SKINS) new

user/email/pop_create.html

<script language="Javascript">
<!--

|HTM_JAVASCRIPT|

// -->
</script>

Then change the form name from "name=info" to "name=reseller".

and also add:

<input type=button value="|LANG_RANDOM|" onClick="randomPass()">

beside the 1st password input box.

larger storage format for homedir bandwidth fixed

The data from /var/log/httpd/homedir.log was being read in and added using "unsigned long" which wasn't big enough. Converted it to "unsigned long long" so which should be plenty big.

ftp main account password change for owned IPs fixed

Bugfix for changing the password of the main ftp account password when the IP is owned. All other accounts are unaffected.

Problem was that the user.conf file was not read in before doing the password change, thus the IP field was blank. This caused the "is the ip owned" function to return 'no', making the ftp password change work on the /etc/proftpd.passwd file instead of the /usr/local/directadmin/data/users/username/ftp.passwd file.

Last Updated: