uploadForm3_iframe.php - Sort Order

Hello, All -

The uploadForm3_iframe.php file contains the following line:

$uploads = getUploadRecords($table, $field, $recordNum, $preSaveTempId);


This is what loads the records to show which files have been uploaded.

Can I control the sort order?

:0/

Perch

By Dave - December 2, 2014

Hi Perch, 

I think it's returned in the same sort order as the uploads are in in the interface.  You could probably sort $uploads after that line, though.

What do you want to sort it on? 

Dave Edis - Senior Developer
interactivetools.com

By Dave - December 2, 2014

Hi Perch, 

I think it's returned in the same sort order as the uploads are in in the interface.  You could probably sort $uploads after that line, though.

What do you want to sort it on? 

Dave Edis - Senior Developer
interactivetools.com

Hi, Folks -

I would like the uploads to be shown in reverse order - with the last one added at the top of the list. I'm using the form as a gallery uploader, so there are a lot of thumbnails. If it adds the last one to the end of the list it will be off the page!

I could sort the uploads by createdTime DESC but recall there's some issue about sorting a multi-dimensional array.

:0/

Perch

By Dave - December 3, 2014

Hi Perch, 

What about this?

$uploads = getUploadRecords($table, $field, $recordNum, $preSaveTempId);
$uploads = array_reverse($uploads);

Let me know if that works for you.

Dave Edis - Senior Developer
interactivetools.com