Sort the listed files with File Genie PHP
I want the files listed in some kind of order. At present it seems totally random. How the file can be sorted?
Answer:
You can sort Folder list through manually editing the Folder List 1.03 code. You could sort the Folder List in to ways: Ascending, Descending.
It can be sorted by following values:
- fileName
- extension
- type
- size
- dateLastModified
To sort by any of the above values pass the value as string for first parameter of processFolder; For second parameter use the order ("ASC" / "DESC").
For example. To sort by file name, you have to modify the following line:
$Upload->processFolder();
to:
$Upload->processFolder("fileName", "ASC"); // For sort by name in ascending order
or:
$Upload->processFolder("fileName", "DESC"); // For sort by name in descending order
DISCLAIMER:
This is extra complimentary content which purpose is to show additional usage that is not part of the product, i.e. it suggests tips for extending the functionality of the product by the users themselves.
It is provided "as is", without warranty of any kind, express or
implied , including but not limited to the warranties of
merchantability, fitness for a particular purpose and nonfringement of
third party rights.
DMXzone does not take responsibility to
support the suggested content to be fully compatible and working as
intended and does not provide support for extended functionality which
is not included in the current release of the extension.
It is highly recommended that only more advanced developers use it.
Comments
Be the first to write a comment
You must me logged in to write a comment.