Storage: File Management: Ls
Ls
Authentication Methods
- With a username and password
Returns a list of files and directories on the requested path.
An ls from a file returns the file info for that file.
Input Parameter | Type | Description |
---|---|---|
Token | String | Security token |
FileServerName | String | FileServer name |
Path | String | Path of the folder |
Output Parameter | Type | Description |
---|---|---|
Paths | PathCollection | Array with a list of all files and folders within the passed folder |
EXAMPLES
Without Filtering
curl 'https://storage.example.com/storage/api.php?Token=rrc1d3ntb53tt6b2vhail6rdtrsxov3v&Task=ls&FileserverName=nmsa000001&Path=directory'
RESPONSE
<Response>
<Status>1</Status>
<Message></Message>
<FileInfos>
<FileInfo>
<Name>abc.txt</Name>
<Path>/directory/</Path>
<IsFolder>false</IsFolder>
<LastModifiedDstamp>1247989470</LastModifiedDstamp>
<Size>1247990693</Size>
<Type>File</Type>
<HasNotifications>true</HasNotifications>
<Notification>nmnt000000000001</Notification>
<HasPreview>false</HasPreview>
<IsEditable>false</IsEditable>
</FileInfo>
<FileInfo>
<Name>testdirectory</Name>
<Path>/directory/</Path>
<IsFolder>true</IsFolder>
<LastModifiedDstamp>1247990719</LastModifiedDstamp>
<Size></Size>
<Type></Type>
<HasNotifications>true</HasNotifications>
<Notification>nmnt000000000002</Notification>
<HasPreview>false</HasPreview>
<IsEditable>false</IsEditable>
</FileInfo>
</FileInfos>
</Response>
With Filtering
Type can be 'Directory' or 'File'
curl -v 'https://storage.example.com/storage/api.php?Token=rrc1d3ntb53tt6b2vhail6rdtrsxov3v&Task=ls&FileserverName=nmsa000001&Path=directory&FilterBy[]=Type&FilterValue[]=File'
RESPONSE
<Response>
<Status>1</Status>
<Message></Message>
<FileInfos>
<FileInfo>
<Name>abc.txt</Name>
<Path>/directory/</Path>
<IsFolder>false</IsFolder>
<LastModifiedDstamp>1247989470</LastModifiedDstamp>
<Size>1247990693</Size>
<Type>File</Type>
<HasNotifications>true</HasNotifications>
<Notification>nmnt000000000001</Notification>
<HasPreview>false</HasPreview>
<IsEditable>false</IsEditable>
</FileInfo>
</FileInfos>
</Response>